Skip to content

Commit e39d537

Browse files
committed
Added tests differentiating between lexical and mathematical integers.
Integer literals should be considered integers, while mathematical integers can be specified with divisibleBy. See: json-schema/json-schema#27 Closes #2
1 parent 44540b7 commit e39d537

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/draft3/type.json

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"data": 1.1,
1414
"valid": false
1515
},
16+
{
17+
"description": "a float is not an integer even without fractional part",
18+
"data": 1.0,
19+
"valid": false
20+
},
1621
{
1722
"description": "a string is not an integer",
1823
"data": "foo",

tests/draft3/uniqueItems.json

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"data": [1, 1],
1414
"valid": false
1515
},
16+
{
17+
"description": "numbers are unique if mathematically unequal",
18+
"data": [1.0, 1.00, 1],
19+
"valid": false
20+
},
1621
{
1722
"description": "unique array of objects is valid",
1823
"data": [{"foo": "bar"}, {"foo": "baz"}],

0 commit comments

Comments
 (0)