Skip to content

Commit 92eeeb4

Browse files
authored
Merge pull request #258 from gzzi/master
Add test with negative integer for minimum
2 parents 3c3881a + 60d5ff4 commit 92eeeb4

File tree

4 files changed

+124
-0
lines changed

4 files changed

+124
-0
lines changed

tests/draft3/minimum.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,36 @@
3838
"valid": false
3939
}
4040
]
41+
},
42+
{
43+
"description": "minimum validation with signed integer",
44+
"schema": {"minimum": -2},
45+
"tests": [
46+
{
47+
"description": "negative above the minimum is valid",
48+
"data": -1,
49+
"valid": true
50+
},
51+
{
52+
"description": "positive above the minimum is valid",
53+
"data": 0,
54+
"valid": true
55+
},
56+
{
57+
"description": "boundary point is valid",
58+
"data": -2,
59+
"valid": true
60+
},
61+
{
62+
"description": "below the minimum is invalid",
63+
"data": -3,
64+
"valid": false
65+
},
66+
{
67+
"description": "ignores non-numbers",
68+
"data": "x",
69+
"valid": true
70+
}
71+
]
4172
}
4273
]

tests/draft4/minimum.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,36 @@
6969
"valid": false
7070
}
7171
]
72+
},
73+
{
74+
"description": "minimum validation with signed integer",
75+
"schema": {"minimum": -2},
76+
"tests": [
77+
{
78+
"description": "negative above the minimum is valid",
79+
"data": -1,
80+
"valid": true
81+
},
82+
{
83+
"description": "positive above the minimum is valid",
84+
"data": 0,
85+
"valid": true
86+
},
87+
{
88+
"description": "boundary point is valid",
89+
"data": -2,
90+
"valid": true
91+
},
92+
{
93+
"description": "below the minimum is invalid",
94+
"data": -3,
95+
"valid": false
96+
},
97+
{
98+
"description": "ignores non-numbers",
99+
"data": "x",
100+
"valid": true
101+
}
102+
]
72103
}
73104
]

tests/draft6/minimum.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,36 @@
2424
"valid": true
2525
}
2626
]
27+
},
28+
{
29+
"description": "minimum validation with signed integer",
30+
"schema": {"minimum": -2},
31+
"tests": [
32+
{
33+
"description": "negative above the minimum is valid",
34+
"data": -1,
35+
"valid": true
36+
},
37+
{
38+
"description": "positive above the minimum is valid",
39+
"data": 0,
40+
"valid": true
41+
},
42+
{
43+
"description": "boundary point is valid",
44+
"data": -2,
45+
"valid": true
46+
},
47+
{
48+
"description": "below the minimum is invalid",
49+
"data": -3,
50+
"valid": false
51+
},
52+
{
53+
"description": "ignores non-numbers",
54+
"data": "x",
55+
"valid": true
56+
}
57+
]
2758
}
2859
]

tests/draft7/minimum.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,36 @@
2424
"valid": true
2525
}
2626
]
27+
},
28+
{
29+
"description": "minimum validation with signed integer",
30+
"schema": {"minimum": -2},
31+
"tests": [
32+
{
33+
"description": "negative above the minimum is valid",
34+
"data": -1,
35+
"valid": true
36+
},
37+
{
38+
"description": "positive above the minimum is valid",
39+
"data": 0,
40+
"valid": true
41+
},
42+
{
43+
"description": "boundary point is valid",
44+
"data": -2,
45+
"valid": true
46+
},
47+
{
48+
"description": "below the minimum is invalid",
49+
"data": -3,
50+
"valid": false
51+
},
52+
{
53+
"description": "ignores non-numbers",
54+
"data": "x",
55+
"valid": true
56+
}
57+
]
2758
}
2859
]

0 commit comments

Comments
 (0)