Skip to content

Commit 5aff83e

Browse files
committed
reintroduce tests without using if/then/else
1 parent 9495e3e commit 5aff83e

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

tests/draft6/id.json

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,87 @@
4848
"valid": false
4949
}
5050
]
51+
},
52+
{
53+
"description": "non-schema object containing a plain-name $id property",
54+
"schema": {
55+
"$defs": {
56+
"const_not_anchor": {
57+
"const": {
58+
"$id": "#not_a_real_anchor"
59+
}
60+
}
61+
},
62+
"oneOf": [
63+
{
64+
"const": "skip not_a_real_anchor"
65+
},
66+
{
67+
"allOf": [
68+
{
69+
"not": {
70+
"const": "skip not_a_real_anchor"
71+
}
72+
},
73+
{
74+
"$ref": "#/$defs/const_not_anchor"
75+
}
76+
]
77+
}
78+
]
79+
},
80+
"tests": [
81+
{
82+
"description": "skip traversing definition for a valid result",
83+
"data": "skip not_a_real_anchor",
84+
"valid": true
85+
},
86+
{
87+
"description": "const at const_not_anchor does not match",
88+
"data": 1,
89+
"valid": false
90+
}
91+
]
92+
},
93+
{
94+
"description": "non-schema object containing an $id property",
95+
"schema": {
96+
"$defs": {
97+
"const_not_id": {
98+
"const": {
99+
"$id": "not_a_real_id"
100+
}
101+
}
102+
},
103+
"oneOf": [
104+
{
105+
"const":"skip not_a_real_id"
106+
},
107+
{
108+
"allOf": [
109+
{
110+
"not": {
111+
"const": "skip not_a_real_id"
112+
}
113+
},
114+
{
115+
"$ref": "#/$defs/const_not_id"
116+
}
117+
]
118+
}
119+
]
120+
},
121+
"tests": [
122+
{
123+
"description": "skip traversing definition for a valid result",
124+
"data": "skip not_a_real_id",
125+
"valid": true
126+
},
127+
{
128+
"description": "const at const_not_id does not match",
129+
"data": 1,
130+
"valid": false
131+
}
132+
]
51133
}
52134
]

0 commit comments

Comments
 (0)