Skip to content

Commit caa8579

Browse files
committed
testsuite update
1 parent 18b9fe7 commit caa8579

File tree

9 files changed

+225
-20
lines changed

9 files changed

+225
-20
lines changed

tests/src/test/resources/org/everit/json/schema/draft6/additionalProperties.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,20 @@
1919
"valid": false
2020
},
2121
{
22-
"description": "ignores non-objects",
22+
"description": "ignores arrays",
2323
"data": [1, 2, 3],
2424
"valid": true
2525
},
26+
{
27+
"description": "ignores strings",
28+
"data": "foobarbaz",
29+
"valid": true
30+
},
31+
{
32+
"description": "ignores other non-objects",
33+
"data": 12,
34+
"valid": true
35+
},
2636
{
2737
"description": "patternProperties are not additional properties",
2838
"data": {"foo":1, "vroom": 2},

tests/src/test/resources/org/everit/json/schema/draft6/dependencies.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,18 @@
2626
"valid": false
2727
},
2828
{
29-
"description": "ignores non-objects",
30-
"data": "foo",
29+
"description": "ignores arrays",
30+
"data": ["bar"],
31+
"valid": true
32+
},
33+
{
34+
"description": "ignores strings",
35+
"data": "foobar",
36+
"valid": true
37+
},
38+
{
39+
"description": "ignores other non-objects",
40+
"data": 12,
3141
"valid": true
3242
}
3343
]

tests/src/test/resources/org/everit/json/schema/draft6/maxProperties.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@
1919
"valid": false
2020
},
2121
{
22-
"description": "ignores non-objects",
22+
"description": "ignores arrays",
23+
"data": [1, 2, 3],
24+
"valid": true
25+
},
26+
{
27+
"description": "ignores strings",
2328
"data": "foobar",
2429
"valid": true
30+
},
31+
{
32+
"description": "ignores other non-objects",
33+
"data": 12,
34+
"valid": true
2535
}
2636
]
2737
}

tests/src/test/resources/org/everit/json/schema/draft6/minProperties.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@
1919
"valid": false
2020
},
2121
{
22-
"description": "ignores non-objects",
22+
"description": "ignores arrays",
23+
"data": [],
24+
"valid": true
25+
},
26+
{
27+
"description": "ignores strings",
2328
"data": "",
2429
"valid": true
30+
},
31+
{
32+
"description": "ignores other non-objects",
33+
"data": 12,
34+
"valid": true
2535
}
2636
]
2737
}

tests/src/test/resources/org/everit/json/schema/draft6/optional/format.json

Lines changed: 140 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
]
221221
},
222222
{
223-
"description": "validation of JSON-pointers",
223+
"description": "validation of JSON-pointers (JSON String Representation)",
224224
"schema": {"format": "json-pointer"},
225225
"tests": [
226226
{
@@ -229,29 +229,159 @@
229229
"valid": true
230230
},
231231
{
232-
"description": "empty string is valid",
232+
"description": "not a valid JSON-pointer (~ not escaped)",
233+
"data": "/foo/bar~",
234+
"valid": false
235+
},
236+
{
237+
"description": "valid JSON-pointer with empty segment",
238+
"data": "/foo//bar",
239+
"valid": true
240+
},
241+
{
242+
"description": "valid JSON-pointer with the last empty segment",
243+
"data": "/foo/bar/",
244+
"valid": true
245+
},
246+
{
247+
"description": "valid JSON-pointer as stated in RFC 6901 #1",
233248
"data": "",
234249
"valid": true
235250
},
236251
{
237-
"description": "/ is valid",
252+
"description": "valid JSON-pointer as stated in RFC 6901 #2",
253+
"data": "/foo",
254+
"valid": true
255+
},
256+
{
257+
"description": "valid JSON-pointer as stated in RFC 6901 #3",
258+
"data": "/foo/0",
259+
"valid": true
260+
},
261+
{
262+
"description": "valid JSON-pointer as stated in RFC 6901 #4",
238263
"data": "/",
239264
"valid": true
240265
},
241266
{
242-
"description": "not a valid JSON-pointer (~ not escaped)",
243-
"data": "/foo/bar~",
244-
"valid": false
267+
"description": "valid JSON-pointer as stated in RFC 6901 #5",
268+
"data": "/a~1b",
269+
"valid": true
245270
},
246271
{
247-
"description": "valid JSON-pointer with empty segment",
248-
"data": "/foo//bar",
272+
"description": "valid JSON-pointer as stated in RFC 6901 #6",
273+
"data": "/c%d",
249274
"valid": true
250275
},
251276
{
252-
"description": "valid JSON-pointer with the last empty segment",
253-
"data": "/foo/bar/",
277+
"description": "valid JSON-pointer as stated in RFC 6901 #7",
278+
"data": "/e^f",
279+
"valid": true
280+
},
281+
{
282+
"description": "valid JSON-pointer as stated in RFC 6901 #8",
283+
"data": "/g|h",
284+
"valid": true
285+
},
286+
{
287+
"description": "valid JSON-pointer as stated in RFC 6901 #9",
288+
"data": "/i\\j",
289+
"valid": true
290+
},
291+
{
292+
"description": "valid JSON-pointer as stated in RFC 6901 #10",
293+
"data": "/k\"l",
294+
"valid": true
295+
},
296+
{
297+
"description": "valid JSON-pointer as stated in RFC 6901 #11",
298+
"data": "/ ",
299+
"valid": true
300+
},
301+
{
302+
"description": "valid JSON-pointer as stated in RFC 6901 #12",
303+
"data": "/m~0n",
304+
"valid": true
305+
},
306+
{
307+
"description": "valid JSON-pointer used adding to the last array position",
308+
"data": "/foo/-",
309+
"valid": true
310+
},
311+
{
312+
"description": "valid JSON-pointer (- used as object member name)",
313+
"data": "/foo/-/bar",
314+
"valid": true
315+
},
316+
{
317+
"description": "valid JSON-pointer (multiple escaped characters)",
318+
"data": "/~1~0~0~1~1",
319+
"valid": true
320+
},
321+
{
322+
"description": "valid JSON-pointer (escaped with fraction part) #1",
323+
"data": "/~1.1",
254324
"valid": true
325+
},
326+
{
327+
"description": "valid JSON-pointer (escaped with fraction part) #2",
328+
"data": "/~0.1",
329+
"valid": true
330+
},
331+
{
332+
"description": "not a valid JSON-pointer (URI Fragment Identifier) #1",
333+
"data": "#",
334+
"valid": false
335+
},
336+
{
337+
"description": "not a valid JSON-pointer (URI Fragment Identifier) #2",
338+
"data": "#/",
339+
"valid": false
340+
},
341+
{
342+
"description": "not a valid JSON-pointer (URI Fragment Identifier) #3",
343+
"data": "#a",
344+
"valid": false
345+
},
346+
{
347+
"description": "not a valid JSON-pointer (some escaped, but not all) #1",
348+
"data": "/~0~",
349+
"valid": false
350+
},
351+
{
352+
"description": "not a valid JSON-pointer (some escaped, but not all) #2",
353+
"data": "/~0/~",
354+
"valid": false
355+
},
356+
{
357+
"description": "not a valid JSON-pointer (wrong escape character) #1",
358+
"data": "/~2",
359+
"valid": false
360+
},
361+
{
362+
"description": "not a valid JSON-pointer (wrong escape character) #2",
363+
"data": "/~-1",
364+
"valid": false
365+
},
366+
{
367+
"description": "not a valid JSON-pointer (multiple characters not escaped)",
368+
"data": "/~~",
369+
"valid": false
370+
},
371+
{
372+
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #1",
373+
"data": "a",
374+
"valid": false
375+
},
376+
{
377+
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #2",
378+
"data": "0",
379+
"valid": false
380+
},
381+
{
382+
"description": "not a valid JSON-pointer (isn't empty nor starts with /) #3",
383+
"data": "a/a",
384+
"valid": false
255385
}
256386
]
257387
}

tests/src/test/resources/org/everit/json/schema/draft6/patternProperties.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@
2929
"valid": false
3030
},
3131
{
32-
"description": "ignores non-objects",
32+
"description": "ignores arrays",
33+
"data": ["foo"],
34+
"valid": true
35+
},
36+
{
37+
"description": "ignores strings",
38+
"data": "foo",
39+
"valid": true
40+
},
41+
{
42+
"description": "ignores other non-objects",
3343
"data": 12,
3444
"valid": true
3545
}

tests/src/test/resources/org/everit/json/schema/draft6/properties.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,14 @@
2929
"valid": true
3030
},
3131
{
32-
"description": "ignores non-objects",
32+
"description": "ignores arrays",
3333
"data": [],
3434
"valid": true
35+
},
36+
{
37+
"description": "ignores other non-objects",
38+
"data": 12,
39+
"valid": true
3540
}
3641
]
3742
},

tests/src/test/resources/org/everit/json/schema/draft6/propertyNames.json

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,18 @@
2727
"valid": true
2828
},
2929
{
30-
"description": "non-object is valid",
31-
"data": [],
30+
"description": "ignores arrays",
31+
"data": [1, 2, 3, 4],
32+
"valid": true
33+
},
34+
{
35+
"description": "ignores strings",
36+
"data": "foobar",
37+
"valid": true
38+
},
39+
{
40+
"description": "ignores other non-objects",
41+
"data": 12,
3242
"valid": true
3343
}
3444
]

tests/src/test/resources/org/everit/json/schema/draft6/required.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@
2020
"valid": false
2121
},
2222
{
23-
"description": "ignores non-objects",
23+
"description": "ignores arrays",
24+
"data": [],
25+
"valid": true
26+
},
27+
{
28+
"description": "ignores strings",
29+
"data": "",
30+
"valid": true
31+
},
32+
{
33+
"description": "ignores other non-objects",
2434
"data": 12,
2535
"valid": true
2636
}

0 commit comments

Comments
 (0)