Skip to content

Commit 2f6bb83

Browse files
committed
Squashed 'json/' changes from cb2b906..ff448af
ff448af Merge pull request #220 from pboettch/master f8bee5b test false-exclusivity for max/min numbers git-subtree-dir: json git-subtree-split: ff448afa0a06c821c46a97e6d689974813c8f466
1 parent 1079aeb commit 2f6bb83

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

tests/draft4/maximum.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,32 @@
2525
}
2626
]
2727
},
28+
{
29+
"description": "maximum validation (explicit false exclusivity)",
30+
"schema": {"maximum": 3.0, "exclusiveMaximum": false},
31+
"tests": [
32+
{
33+
"description": "below the maximum is valid",
34+
"data": 2.6,
35+
"valid": true
36+
},
37+
{
38+
"description": "boundary point is valid",
39+
"data": 3.0,
40+
"valid": true
41+
},
42+
{
43+
"description": "above the maximum is invalid",
44+
"data": 3.5,
45+
"valid": false
46+
},
47+
{
48+
"description": "ignores non-numbers",
49+
"data": "x",
50+
"valid": true
51+
}
52+
]
53+
},
2854
{
2955
"description": "exclusiveMaximum validation",
3056
"schema": {

tests/draft4/minimum.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,32 @@
2525
}
2626
]
2727
},
28+
{
29+
"description": "minimum validation (explicit false exclusivity)",
30+
"schema": {"minimum": 1.1, "exclusiveMinimum": false},
31+
"tests": [
32+
{
33+
"description": "above the minimum is valid",
34+
"data": 2.6,
35+
"valid": true
36+
},
37+
{
38+
"description": "boundary point is valid",
39+
"data": 1.1,
40+
"valid": true
41+
},
42+
{
43+
"description": "below the minimum is invalid",
44+
"data": 0.6,
45+
"valid": false
46+
},
47+
{
48+
"description": "ignores non-numbers",
49+
"data": "x",
50+
"valid": true
51+
}
52+
]
53+
},
2854
{
2955
"description": "exclusiveMinimum validation",
3056
"schema": {

0 commit comments

Comments
 (0)