X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=examples%2Fbiojson-doc%2Ftests%2FmultipleOf.json;fp=examples%2Fbiojson-doc%2Ftests%2FmultipleOf.json;h=ca3b7618053f499c3f996e64ccd0efc4f15766a8;hb=9623cea766a766683243235557ad48e6f7659e6a;hp=0000000000000000000000000000000000000000;hpb=6066400ed6b0fe288ebbea82389f59838a534706;p=jalview.git diff --git a/examples/biojson-doc/tests/multipleOf.json b/examples/biojson-doc/tests/multipleOf.json new file mode 100755 index 0000000..ca3b761 --- /dev/null +++ b/examples/biojson-doc/tests/multipleOf.json @@ -0,0 +1,60 @@ +[ + { + "description": "by int", + "schema": {"multipleOf": 2}, + "tests": [ + { + "description": "int by int", + "data": 10, + "valid": true + }, + { + "description": "int by int fail", + "data": 7, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "foo", + "valid": true + } + ] + }, + { + "description": "by number", + "schema": {"multipleOf": 1.5}, + "tests": [ + { + "description": "zero is multiple of anything", + "data": 0, + "valid": true + }, + { + "description": "4.5 is multiple of 1.5", + "data": 4.5, + "valid": true + }, + { + "description": "35 is not multiple of 1.5", + "data": 35, + "valid": false + } + ] + }, + { + "description": "by small number", + "schema": {"multipleOf": 0.0001}, + "tests": [ + { + "description": "0.0075 is multiple of 0.0001", + "data": 0.0075, + "valid": true + }, + { + "description": "0.00751 is not multiple of 0.0001", + "data": 0.00751, + "valid": false + } + ] + } +]