From 43075285ed7271d9caaa02caa1747ead3cbb27ef Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sun, 5 Oct 2014 13:41:06 -0400 Subject: [PATCH] Squashed 'json/' changes from abdd47f..3cef243 3cef243 Applies to Draft4 as well. f323723 Check comparisons for very negative numbers as well. c73cf22 Merge pull request #60 from gilesbowkett/added-jsck-to-who-uses-it e77c86a jsck uses JSON Schema Test Suite 1a96775 Merge pull request #57 from tanaka-tatsuya/fix/max-length-test-case b124928 fixed maxLength test case git-subtree-dir: json git-subtree-split: 3cef243acce1290c8bbbc546f7f3fcbd6c10ff8b --- README.md | 1 + tests/draft3/optional/bignum.json | 47 +++++++++++++++++++++++++++++++ tests/draft4/maxLength.json | 2 +- tests/draft4/optional/bignum.json | 47 +++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 12c49c0..d0b4640 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Who Uses the Test Suite This suite is being used by: + * [jsck (a fast JSON validator in CoffeeScript)](https://github.com/pandastrike/jsck) * [json-schema-validator (Java)](https://github.com/fge/json-schema-validator) * [jsonschema (python)](https://github.com/Julian/jsonschema) * [aeson-schema (haskell)](https://github.com/timjb/aeson-schema) diff --git a/tests/draft3/optional/bignum.json b/tests/draft3/optional/bignum.json index cd47994..ccc7c17 100644 --- a/tests/draft3/optional/bignum.json +++ b/tests/draft3/optional/bignum.json @@ -21,6 +21,28 @@ } ] }, + { + "description": "integer", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "a negative bignum is an integer", + "data": -12345678910111213141516171819202122232425262728293031, + "valid": true + } + ] + }, + { + "description": "number", + "schema": {"type": "number"}, + "tests": [ + { + "description": "a negative bignum is a number", + "data": -98249283749234923498293171823948729348710298301928331, + "valid": true + } + ] + }, { "description": "string", "schema": {"type": "string"}, @@ -56,5 +78,30 @@ "valid": false } ] + }, + { + "description": "integer comparison", + "schema": {"minimum": -18446744073709551615}, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -18446744073709551600, + "valid": true + } + ] + }, + { + "description": "float comparison with high precision on negative numbers", + "schema": { + "minimum": -972783798187987123879878123.18878137, + "exclusiveMinimum": true + }, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -972783798187987123879878123.188781371, + "valid": false + } + ] } ] diff --git a/tests/draft4/maxLength.json b/tests/draft4/maxLength.json index 4de42bc..811d35b 100644 --- a/tests/draft4/maxLength.json +++ b/tests/draft4/maxLength.json @@ -20,7 +20,7 @@ }, { "description": "ignores non-strings", - "data": 10, + "data": 100, "valid": true }, { diff --git a/tests/draft4/optional/bignum.json b/tests/draft4/optional/bignum.json index cd47994..ccc7c17 100644 --- a/tests/draft4/optional/bignum.json +++ b/tests/draft4/optional/bignum.json @@ -21,6 +21,28 @@ } ] }, + { + "description": "integer", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "a negative bignum is an integer", + "data": -12345678910111213141516171819202122232425262728293031, + "valid": true + } + ] + }, + { + "description": "number", + "schema": {"type": "number"}, + "tests": [ + { + "description": "a negative bignum is a number", + "data": -98249283749234923498293171823948729348710298301928331, + "valid": true + } + ] + }, { "description": "string", "schema": {"type": "string"}, @@ -56,5 +78,30 @@ "valid": false } ] + }, + { + "description": "integer comparison", + "schema": {"minimum": -18446744073709551615}, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -18446744073709551600, + "valid": true + } + ] + }, + { + "description": "float comparison with high precision on negative numbers", + "schema": { + "minimum": -972783798187987123879878123.18878137, + "exclusiveMinimum": true + }, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -972783798187987123879878123.188781371, + "valid": false + } + ] } ]