Skip to content

Commit

Permalink
add test for check int
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Apr 20, 2019
1 parent 03e427e commit 21133aa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions validation_test.go
Expand Up @@ -74,6 +74,11 @@ func TestMap(t *testing.T) {
v.StringRule("oldSt", "ltField:newSt")
v.StringRule("oldSt", "lteField:newSt")
is.True(v.Validate())

v = New(M{"age": 12.34})
v.AddRule("age", "int")
is.False(v.Validate())
is.Equal("age value must be an integer", v.Errors.One())
}

func TestValidation_StringRule(t *testing.T) {
Expand Down

0 comments on commit 21133aa

Please sign in to comment.