Skip to content

Commit

Permalink
Fix #186
Browse files Browse the repository at this point in the history
  • Loading branch information
asaskevich committed Apr 25, 2017
1 parent cc7fbb1 commit 700b7e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion patterns.go
Expand Up @@ -14,7 +14,7 @@ const (
UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
Alpha string = "^[a-zA-Z]+$"
Alphanumeric string = "^[a-zA-Z0-9]+$"
Numeric string = "^[-+]?[0-9]+$"
Numeric string = "^[0-9]+$"
Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$"
Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$"
Hexadecimal string = "^[0-9a-fA-F]+$"
Expand Down
8 changes: 4 additions & 4 deletions validator_test.go
Expand Up @@ -284,10 +284,10 @@ func TestIsNumeric(t *testing.T) {
{"\u0030", true}, //UTF-8(ASCII): 0
{"123", true},
{"0123", true},
{"-00123", true},
{"+00123", true},
{"-00123", false},
{"+00123", false},
{"0", true},
{"-0", true},
{"-0", false},
{"123.123", false},
{" ", false},
{".", false},
Expand All @@ -306,7 +306,7 @@ func TestIsNumeric(t *testing.T) {
{"1+1", false},
{"+", false},
{"++", false},
{"+1", true},
{"+1", false},
}
for _, test := range tests {
actual := IsNumeric(test.param)
Expand Down

0 comments on commit 700b7e7

Please sign in to comment.