Skip to content

Commit fa6f4dd

Browse files
1 parent 4f66078 commit fa6f4dd

File tree

8 files changed

+128
-0
lines changed

8 files changed

+128
-0
lines changed

tests/draft2019-09/const.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,5 +238,21 @@
238238
"valid": false
239239
}
240240
]
241+
},
242+
{
243+
"description": "nul characters in strings",
244+
"schema": { "const": "hello\u0000there" },
245+
"tests": [
246+
{
247+
"description": "match string with nul",
248+
"data": "hello\u0000there",
249+
"valid": true
250+
},
251+
{
252+
"description": "do not match string lacking nul",
253+
"data": "hellothere",
254+
"valid": false
255+
}
256+
]
241257
}
242258
]

tests/draft2019-09/enum.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,21 @@
206206
"valid": true
207207
}
208208
]
209+
},
210+
{
211+
"description": "nul characters in strings",
212+
"schema": { "enum": [ "hello\u0000there" ] },
213+
"tests": [
214+
{
215+
"description": "match string with nul",
216+
"data": "hello\u0000there",
217+
"valid": true
218+
},
219+
{
220+
"description": "do not match string lacking nul",
221+
"data": "hellothere",
222+
"valid": false
223+
}
224+
]
209225
}
210226
]

tests/draft3/enum.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,21 @@
9898
"valid": false
9999
}
100100
]
101+
},
102+
{
103+
"description": "nul characters in strings",
104+
"schema": { "enum": [ "hello\u0000there" ] },
105+
"tests": [
106+
{
107+
"description": "match string with nul",
108+
"data": "hello\u0000there",
109+
"valid": true
110+
},
111+
{
112+
"description": "do not match string lacking nul",
113+
"data": "hellothere",
114+
"valid": false
115+
}
116+
]
101117
}
102118
]

tests/draft4/enum.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,21 @@
206206
"valid": true
207207
}
208208
]
209+
},
210+
{
211+
"description": "nul characters in strings",
212+
"schema": { "enum": [ "hello\u0000there" ] },
213+
"tests": [
214+
{
215+
"description": "match string with nul",
216+
"data": "hello\u0000there",
217+
"valid": true
218+
},
219+
{
220+
"description": "do not match string lacking nul",
221+
"data": "hellothere",
222+
"valid": false
223+
}
224+
]
209225
}
210226
]

tests/draft6/const.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,5 +238,21 @@
238238
"valid": false
239239
}
240240
]
241+
},
242+
{
243+
"description": "nul characters in strings",
244+
"schema": { "const": "hello\u0000there" },
245+
"tests": [
246+
{
247+
"description": "match string with nul",
248+
"data": "hello\u0000there",
249+
"valid": true
250+
},
251+
{
252+
"description": "do not match string lacking nul",
253+
"data": "hellothere",
254+
"valid": false
255+
}
256+
]
241257
}
242258
]

tests/draft6/enum.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,21 @@
206206
"valid": true
207207
}
208208
]
209+
},
210+
{
211+
"description": "nul characters in strings",
212+
"schema": { "enum": [ "hello\u0000there" ] },
213+
"tests": [
214+
{
215+
"description": "match string with nul",
216+
"data": "hello\u0000there",
217+
"valid": true
218+
},
219+
{
220+
"description": "do not match string lacking nul",
221+
"data": "hellothere",
222+
"valid": false
223+
}
224+
]
209225
}
210226
]

tests/draft7/const.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,5 +238,21 @@
238238
"valid": false
239239
}
240240
]
241+
},
242+
{
243+
"description": "nul characters in strings",
244+
"schema": { "const": "hello\u0000there" },
245+
"tests": [
246+
{
247+
"description": "match string with nul",
248+
"data": "hello\u0000there",
249+
"valid": true
250+
},
251+
{
252+
"description": "do not match string lacking nul",
253+
"data": "hellothere",
254+
"valid": false
255+
}
256+
]
241257
}
242258
]

tests/draft7/enum.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,21 @@
206206
"valid": true
207207
}
208208
]
209+
},
210+
{
211+
"description": "nul characters in strings",
212+
"schema": { "enum": [ "hello\u0000there" ] },
213+
"tests": [
214+
{
215+
"description": "match string with nul",
216+
"data": "hello\u0000there",
217+
"valid": true
218+
},
219+
{
220+
"description": "do not match string lacking nul",
221+
"data": "hellothere",
222+
"valid": false
223+
}
224+
]
209225
}
210226
]

0 commit comments

Comments
 (0)