From e4ab5bd1f0fb7253825f0ae7b483315ab8f268ad Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Thu, 7 Jan 2016 15:39:45 +0000 Subject: [PATCH 1/2] Check that a string of "1" is not a number and associated tests. --- tests/draft3/type.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/draft3/type.json b/tests/draft3/type.json index 337da120..49c9b40a 100644 --- a/tests/draft3/type.json +++ b/tests/draft3/type.json @@ -18,6 +18,11 @@ "data": "foo", "valid": false }, + { + "description": "a string is still not an integer, even if it looks like one", + "data": "1", + "valid": false + }, { "description": "an object is not an integer", "data": {}, @@ -59,6 +64,11 @@ "data": "foo", "valid": false }, + { + "description": "a string is still not a number, even if it looks like one", + "data": "1", + "valid": false + }, { "description": "an object is not a number", "data": {}, @@ -100,6 +110,11 @@ "data": "foo", "valid": true }, + { + "description": "a string is still a string, even if it looks like a number", + "data": "1", + "valid": true + }, { "description": "an object is not a string", "data": {}, From 9d5909ab5d387cdef1b5d68e29d708eba9135fe0 Mon Sep 17 00:00:00 2001 From: Ben Hutton Date: Thu, 7 Jan 2016 15:41:28 +0000 Subject: [PATCH 2/2] Also check string "1" is not a number in draft 4 --- tests/draft4/type.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/draft4/type.json b/tests/draft4/type.json index db42a44d..61293740 100644 --- a/tests/draft4/type.json +++ b/tests/draft4/type.json @@ -18,6 +18,11 @@ "data": "foo", "valid": false }, + { + "description": "a string is still not an integer, even if it looks like one", + "data": "1", + "valid": false + }, { "description": "an object is not an integer", "data": {}, @@ -59,6 +64,11 @@ "data": "foo", "valid": false }, + { + "description": "a string is still not a number, even if it looks like one", + "data": "1", + "valid": false + }, { "description": "an object is not a number", "data": {}, @@ -100,6 +110,11 @@ "data": "foo", "valid": true }, + { + "description": "a string is still a string, even if it looks like a number", + "data": "1", + "valid": true + }, { "description": "an object is not a string", "data": {},