Skip to content

Commit 65c18d5

Browse files
committed
draft-04/06: items/additionalItems tests
1 parent ed3391c commit 65c18d5

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

tests/draft4/additionalItems.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"additionalItems": false
4040
},
4141
"tests": [
42+
{
43+
"description": "fewer items is valid",
44+
"data": [ 1, 2 ],
45+
"valid": true
46+
},
4247
{
4348
"description": "no additional items present",
4449
"data": [ 1, 2, 3 ],

tests/draft4/items.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
"description": "ignores non-arrays",
2020
"data": {"foo" : "bar"},
2121
"valid": true
22+
},
23+
{
24+
"description": "not array is valid",
25+
"data": {
26+
"0": "invalid",
27+
"length": 1
28+
},
29+
"valid": true
2230
}
2331
]
2432
},
@@ -55,6 +63,15 @@
5563
"description": "empty array",
5664
"data": [ ],
5765
"valid": true
66+
},
67+
{
68+
"description": "not array is valid",
69+
"data": {
70+
"0": "invalid",
71+
"1": "valid",
72+
"length": 2
73+
},
74+
"valid": true
5875
}
5976
]
6077
}

tests/draft6/additionalItems.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"additionalItems": false
4040
},
4141
"tests": [
42+
{
43+
"description": "fewer items is valid",
44+
"data": [ 1, 2 ],
45+
"valid": true
46+
},
4247
{
4348
"description": "no additional items present",
4449
"data": [ 1, 2, 3 ],

tests/draft6/items.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
"description": "ignores non-arrays",
2020
"data": {"foo" : "bar"},
2121
"valid": true
22+
},
23+
{
24+
"description": "not array is valid",
25+
"data": {
26+
"0": "invalid",
27+
"length": 1
28+
},
29+
"valid": true
2230
}
2331
]
2432
},
@@ -55,6 +63,15 @@
5563
"description": "empty array",
5664
"data": [ ],
5765
"valid": true
66+
},
67+
{
68+
"description": "not array is valid",
69+
"data": {
70+
"0": "invalid",
71+
"1": "valid",
72+
"length": 2
73+
},
74+
"valid": true
5875
}
5976
]
6077
}

0 commit comments

Comments
 (0)