mirror of
https://github.com/aclindsa/ofxgo.git
synced 2025-06-30 19:28:39 -04:00
Use named constants instead of strings for enum-like OFX fields
This adds a python script to generate constants.go when `go generate` is called, and updates the structs, tests, and command-line client to all use the new named constants.
This commit is contained in:
@ -121,6 +121,10 @@ func checkEqual(t *testing.T, fieldName string, expected, actual reflect.Value)
|
||||
if expected.String() != actual.String() {
|
||||
t.Fatalf("%s: %s expected to be '%s', found '%s'\n", t.Name(), fieldName, expected.String(), actual.String())
|
||||
}
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
|
||||
if expected.Uint() != actual.Uint() {
|
||||
t.Fatalf("%s: %s expected to be '%s', found '%s'\n", t.Name(), fieldName, valueToString(expected), valueToString(actual))
|
||||
}
|
||||
default:
|
||||
t.Fatalf("%s: %s has unexpected type that didn't provide an Equal() method: %s\n", t.Name(), fieldName, expected.Type().Name())
|
||||
}
|
||||
|
Reference in New Issue
Block a user