File tree Expand file tree Collapse file tree 1 file changed +65
-1
lines changed
Expand file tree Collapse file tree 1 file changed +65
-1
lines changed Original file line number Diff line number Diff line change 264264 "valid" : false
265265 }
266266 ]
267- }
267+ },
268+ {
269+ "description" : " then: false should fail if condition matches" ,
270+ "schema" : {
271+ "if" : { "const" : 1 },
272+ "then" : false
273+ },
274+ "tests" : [
275+ {
276+ "description" : " matches if → then=false → invalid" ,
277+ "data" : 1 ,
278+ "valid" : false
279+ },
280+ {
281+ "description" : " does not match if → then ignored → valid" ,
282+ "data" : 2 ,
283+ "valid" : true
284+ }
285+ ]
286+ },
287+ {
288+ "description" : " else: false should fail when if condition does not match" ,
289+ "schema" : {
290+ "if" : {
291+ "properties" :{
292+ "name" :{"type" :" string" }
293+ },
294+ "required" : [" name" ]
295+ },
296+ "else" : false
297+ },
298+ "tests" : [
299+ {
300+ "description" : " does not match if → else executes → invalid" ,
301+ "data" : 2 ,
302+ "valid" : false
303+ },
304+ {
305+ "description" : " matches if → else does not execute → valid" ,
306+ "data" :{"name" :" foo" },
307+ "valid" :true
308+ }
309+ ]
310+ },
311+ {
312+ "description" : " then and else both are false" ,
313+ "schema" :{
314+ "if" :{"type" :" number" },
315+ "then" :false ,
316+ "else" :false
317+ },
318+ "tests" :[
319+ {
320+ "description" : " matches if → then executes and else does not execute →invalid" ,
321+ "data" : 4 ,
322+ "valid" : false
323+ },
324+ {
325+ "description" : " does not match if → else executes →invalid" ,
326+ "data" : " foo" ,
327+ "valid" : false
328+ }
329+ ]
330+ }
268331]
332+
You can’t perform that action at this time.
0 commit comments