X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=examples%2Fbiojson-doc%2Ftests%2Fnot.json;fp=examples%2Fbiojson-doc%2Ftests%2Fnot.json;h=2cdc979003ca7eaf7d979ab36147eb80ca0fa5ac;hb=1ba05544b34253204ef6410017a179c31fe5e23d;hp=0000000000000000000000000000000000000000;hpb=f8ce78dc02ce9d96129fcc4882749f43869928ff;p=jalview.git diff --git a/examples/biojson-doc/tests/not.json b/examples/biojson-doc/tests/not.json new file mode 100755 index 0000000..2cdc979 --- /dev/null +++ b/examples/biojson-doc/tests/not.json @@ -0,0 +1,73 @@ +[ + { + "description": "not", + "schema": { + "not": {"type": "integer"} + }, + "tests": [ + { + "description": "allowed", + "data": "foo", + "valid": true + }, + { + "description": "disallowed", + "data": 1, + "valid": false + } + ] + }, + { + "description": "not multiple types", + "schema": { + "not": {"type": ["integer", "boolean"]} + }, + "tests": [ + { + "description": "valid", + "data": "foo", + "valid": true + }, + { + "description": "mismatch", + "data": 1, + "valid": false + }, + { + "description": "other mismatch", + "data": true, + "valid": false + } + ] + }, + { + "description": "not more complex schema", + "schema": { + "not": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + }, + "tests": [ + { + "description": "match", + "data": 1, + "valid": true + }, + { + "description": "other match", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "mismatch", + "data": {"foo": "bar"}, + "valid": false + } + ] + } +]