Skip to content

Commit e26d9bc

Browse files
committed
Move the anchor-related tests to an anchor file.
1 parent 19e7dfe commit e26d9bc

File tree

2 files changed

+85
-85
lines changed

2 files changed

+85
-85
lines changed

tests/draft2019-09/anchor.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,87 @@
11
[
2+
{
3+
"description": "Location-independent identifier",
4+
"schema": {
5+
"allOf": [{
6+
"$ref": "#foo"
7+
}],
8+
"$defs": {
9+
"A": {
10+
"$anchor": "foo",
11+
"type": "integer"
12+
}
13+
}
14+
},
15+
"tests": [
16+
{
17+
"data": 1,
18+
"description": "match",
19+
"valid": true
20+
},
21+
{
22+
"data": "a",
23+
"description": "mismatch",
24+
"valid": false
25+
}
26+
]
27+
},
28+
{
29+
"description": "Location-independent identifier with absolute URI",
30+
"schema": {
31+
"allOf": [{
32+
"$ref": "http://localhost:1234/bar#foo"
33+
}],
34+
"$defs": {
35+
"A": {
36+
"$id": "http://localhost:1234/bar",
37+
"$anchor": "foo",
38+
"type": "integer"
39+
}
40+
}
41+
},
42+
"tests": [
43+
{
44+
"data": 1,
45+
"description": "match",
46+
"valid": true
47+
},
48+
{
49+
"data": "a",
50+
"description": "mismatch",
51+
"valid": false
52+
}
53+
]
54+
},
55+
{
56+
"description": "Location-independent identifier with base URI change in subschema",
57+
"schema": {
58+
"$id": "http://localhost:1234/root",
59+
"allOf": [{
60+
"$ref": "http://localhost:1234/nested.json#foo"
61+
}],
62+
"$defs": {
63+
"A": {
64+
"$id": "nested.json",
65+
"$defs": {
66+
"B": {
67+
"$anchor": "foo",
68+
"type": "integer"
69+
}
70+
}
71+
}
72+
}
73+
},
74+
"tests": [
75+
{
76+
"data": 1,
77+
"description": "match",
78+
"valid": true
79+
},
80+
{
81+
"data": "a",
82+
"description": "mismatch",
83+
"valid": false
84+
}
85+
]
86+
}
287
]

tests/draft2019-09/ref.json

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -355,90 +355,5 @@
355355
"valid": false
356356
}
357357
]
358-
},
359-
{
360-
"description": "Location-independent identifier",
361-
"schema": {
362-
"allOf": [{
363-
"$ref": "#foo"
364-
}],
365-
"$defs": {
366-
"A": {
367-
"$anchor": "foo",
368-
"type": "integer"
369-
}
370-
}
371-
},
372-
"tests": [
373-
{
374-
"data": 1,
375-
"description": "match",
376-
"valid": true
377-
},
378-
{
379-
"data": "a",
380-
"description": "mismatch",
381-
"valid": false
382-
}
383-
]
384-
},
385-
{
386-
"description": "Location-independent identifier with absolute URI",
387-
"schema": {
388-
"allOf": [{
389-
"$ref": "http://localhost:1234/bar#foo"
390-
}],
391-
"$defs": {
392-
"A": {
393-
"$id": "http://localhost:1234/bar",
394-
"$anchor": "foo",
395-
"type": "integer"
396-
}
397-
}
398-
},
399-
"tests": [
400-
{
401-
"data": 1,
402-
"description": "match",
403-
"valid": true
404-
},
405-
{
406-
"data": "a",
407-
"description": "mismatch",
408-
"valid": false
409-
}
410-
]
411-
},
412-
{
413-
"description": "Location-independent identifier with base URI change in subschema",
414-
"schema": {
415-
"$id": "http://localhost:1234/root",
416-
"allOf": [{
417-
"$ref": "http://localhost:1234/nested.json#foo"
418-
}],
419-
"$defs": {
420-
"A": {
421-
"$id": "nested.json",
422-
"$defs": {
423-
"B": {
424-
"$anchor": "foo",
425-
"type": "integer"
426-
}
427-
}
428-
}
429-
}
430-
},
431-
"tests": [
432-
{
433-
"data": 1,
434-
"description": "match",
435-
"valid": true
436-
},
437-
{
438-
"data": "a",
439-
"description": "mismatch",
440-
"valid": false
441-
}
442-
]
443358
}
444359
]

0 commit comments

Comments
 (0)