Skip to content

Commit 4a2b52f

Browse files
some tests of items + contains
..to make sure that the presence of one keyword does not interfere with the other
1 parent 7f00cc8 commit 4a2b52f

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

tests/draft2019-09/contains.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,34 @@
9696
"valid": true
9797
}
9898
]
99+
},
100+
{
101+
"description": "items + contains",
102+
"schema": {
103+
"items": { "multipleOf": 2 },
104+
"contains": { "multipleOf": 3 }
105+
},
106+
"tests": [
107+
{
108+
"description": "matches items, does not match contains",
109+
"data": [ 2, 4, 8 ],
110+
"valid": false
111+
},
112+
{
113+
"description": "does not match items, matches contains",
114+
"data": [ 3, 6, 9 ],
115+
"valid": false
116+
},
117+
{
118+
"description": "matches both items and contains",
119+
"data": [ 6, 12 ],
120+
"valid": true
121+
},
122+
{
123+
"description": "matches neither items nor contains",
124+
"data": [ 1, 5 ],
125+
"valid": false
126+
}
127+
]
99128
}
100129
]

tests/draft6/contains.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,34 @@
9696
"valid": true
9797
}
9898
]
99+
},
100+
{
101+
"description": "items + contains",
102+
"schema": {
103+
"items": { "multipleOf": 2 },
104+
"contains": { "multipleOf": 3 }
105+
},
106+
"tests": [
107+
{
108+
"description": "matches items, does not match contains",
109+
"data": [ 2, 4, 8 ],
110+
"valid": false
111+
},
112+
{
113+
"description": "does not match items, matches contains",
114+
"data": [ 3, 6, 9 ],
115+
"valid": false
116+
},
117+
{
118+
"description": "matches both items and contains",
119+
"data": [ 6, 12 ],
120+
"valid": true
121+
},
122+
{
123+
"description": "matches neither items nor contains",
124+
"data": [ 1, 5 ],
125+
"valid": false
126+
}
127+
]
99128
}
100129
]

tests/draft7/contains.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,34 @@
9696
"valid": true
9797
}
9898
]
99+
},
100+
{
101+
"description": "items + contains",
102+
"schema": {
103+
"items": { "multipleOf": 2 },
104+
"contains": { "multipleOf": 3 }
105+
},
106+
"tests": [
107+
{
108+
"description": "matches items, does not match contains",
109+
"data": [ 2, 4, 8 ],
110+
"valid": false
111+
},
112+
{
113+
"description": "does not match items, matches contains",
114+
"data": [ 3, 6, 9 ],
115+
"valid": false
116+
},
117+
{
118+
"description": "matches both items and contains",
119+
"data": [ 6, 12 ],
120+
"valid": true
121+
},
122+
{
123+
"description": "matches neither items nor contains",
124+
"data": [ 1, 5 ],
125+
"valid": false
126+
}
127+
]
99128
}
100129
]

0 commit comments

Comments
 (0)