Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2016-11-30 12:10:38 -0500
committerMike Gerwitz <gerwitzm@lovullo.com>2016-12-01 08:43:51 -0500
commitab3f5f4cb608c58fd0f31ce84ad69d2cde6a6f31 (patch)
tree1b22d49c10e5552d7c9ff18f30044aae38cdffd5 /test
parent5947e7646e2a0955a4ab799db69bdc909d8d0ea3 (diff)
downloadliza-ab3f5f4cb608c58fd0f31ce84ad69d2cde6a6f31.tar.gz
liza-ab3f5f4cb608c58fd0f31ce84ad69d2cde6a6f31.tar.bz2
liza-ab3f5f4cb608c58fd0f31ce84ad69d2cde6a6f31.zip
Validate correct Number format
* src/validate/formatter/Number.js (parse): Validate number format. * test/validate/formatter/NumberTest.js: Modify accordingly.
Diffstat (limited to 'test')
-rw-r--r--test/validate/formatter/NumberTest.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/validate/formatter/NumberTest.js b/test/validate/formatter/NumberTest.js
index 7945b70..0e036d8 100644
--- a/test/validate/formatter/NumberTest.js
+++ b/test/validate/formatter/NumberTest.js
@@ -42,6 +42,10 @@ describe( 'validate.formatter.Number', function()
// strip decimals
"1.234": [ "1", "1" ],
" 1, ,.": [ "1", "1" ],
+
+ // non-numbers
+ "foo": false,
+ "123foo": false,
} );
@@ -62,6 +66,10 @@ describe( 'validate.formatter.Number', function()
"12,345": [ "12345.000", "12,345.000" ],
" 1, ,.": [ "1.000", "1.000" ],
+
+ // non-numbers
+ "1.foo": false,
+ "123foo.012": false,
} );