|
|
|
@ -8149,3 +8149,16 @@ func TestKeyOrs(t *testing.T) { |
|
|
|
|
AssertDeepError(t, errs, "Test2.Test1[badtestkey]", "Test2.Test1[badtestkey]", "Test1[badtestkey]", "Test1[badtestkey]", "okkey", "eq=testkey|eq=testkeyok") |
|
|
|
|
AssertDeepError(t, errs, "Test2.Test1[badtestkey]", "Test2.Test1[badtestkey]", "Test1[badtestkey]", "Test1[badtestkey]", "eq", "eq") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func TestStructLevelValidationsPointerPassing(t *testing.T) { |
|
|
|
|
v1 := New() |
|
|
|
|
v1.RegisterStructValidation(StructValidationTestStruct, &TestStruct{}) |
|
|
|
|
|
|
|
|
|
tst := &TestStruct{ |
|
|
|
|
String: "good value", |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
errs := v1.Struct(tst) |
|
|
|
|
NotEqual(t, errs, nil) |
|
|
|
|
AssertError(t, errs, "TestStruct.StringVal", "TestStruct.String", "StringVal", "String", "badvalueteststruct") |
|
|
|
|
} |
|
|
|
|