|
|
@ -151,6 +151,7 @@ func TestTranslations(t *testing.T) { |
|
|
|
PostCode string `validate:"postcode_iso3166_alpha2=SG"` |
|
|
|
PostCode string `validate:"postcode_iso3166_alpha2=SG"` |
|
|
|
PostCodeCountry string |
|
|
|
PostCodeCountry string |
|
|
|
PostCodeByField string `validate:"postcode_iso3166_alpha2_field=PostCodeCountry"` |
|
|
|
PostCodeByField string `validate:"postcode_iso3166_alpha2_field=PostCodeCountry"` |
|
|
|
|
|
|
|
BooleanString string `validate:"boolean"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var test Test |
|
|
|
var test Test |
|
|
@ -203,6 +204,7 @@ func TestTranslations(t *testing.T) { |
|
|
|
test.UniqueSlice = []string{"1234", "1234"} |
|
|
|
test.UniqueSlice = []string{"1234", "1234"} |
|
|
|
test.UniqueMap = map[string]string{"key1": "1234", "key2": "1234"} |
|
|
|
test.UniqueMap = map[string]string{"key1": "1234", "key2": "1234"} |
|
|
|
test.Datetime = "2008-Feb-01" |
|
|
|
test.Datetime = "2008-Feb-01" |
|
|
|
|
|
|
|
test.BooleanString = "A" |
|
|
|
|
|
|
|
|
|
|
|
test.Inner.RequiredIf = "abcd" |
|
|
|
test.Inner.RequiredIf = "abcd" |
|
|
|
|
|
|
|
|
|
|
@ -684,6 +686,10 @@ func TestTranslations(t *testing.T) { |
|
|
|
ns: "Test.PostCodeByField", |
|
|
|
ns: "Test.PostCodeByField", |
|
|
|
expected: "PostCodeByField does not match postcode format of country in PostCodeCountry field", |
|
|
|
expected: "PostCodeByField does not match postcode format of country in PostCodeCountry field", |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ns: "Test.BooleanString", |
|
|
|
|
|
|
|
expected: "BooleanString must be a valid boolean value", |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for _, tt := range tests { |
|
|
|
for _, tt := range tests { |
|
|
|