Skip to content

Commit 9723c8f

Browse files
committed
Merge pull request #111 from Relequestual/patch-1
Check that a string of "1" is not a number
2 parents 5dc71b8 + 9d5909a commit 9723c8f

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

tests/draft3/type.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
"data": "foo",
1919
"valid": false
2020
},
21+
{
22+
"description": "a string is still not an integer, even if it looks like one",
23+
"data": "1",
24+
"valid": false
25+
},
2126
{
2227
"description": "an object is not an integer",
2328
"data": {},
@@ -59,6 +64,11 @@
5964
"data": "foo",
6065
"valid": false
6166
},
67+
{
68+
"description": "a string is still not a number, even if it looks like one",
69+
"data": "1",
70+
"valid": false
71+
},
6272
{
6373
"description": "an object is not a number",
6474
"data": {},
@@ -100,6 +110,11 @@
100110
"data": "foo",
101111
"valid": true
102112
},
113+
{
114+
"description": "a string is still a string, even if it looks like a number",
115+
"data": "1",
116+
"valid": true
117+
},
103118
{
104119
"description": "an object is not a string",
105120
"data": {},

tests/draft4/type.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
"data": "foo",
1919
"valid": false
2020
},
21+
{
22+
"description": "a string is still not an integer, even if it looks like one",
23+
"data": "1",
24+
"valid": false
25+
},
2126
{
2227
"description": "an object is not an integer",
2328
"data": {},
@@ -59,6 +64,11 @@
5964
"data": "foo",
6065
"valid": false
6166
},
67+
{
68+
"description": "a string is still not a number, even if it looks like one",
69+
"data": "1",
70+
"valid": false
71+
},
6272
{
6373
"description": "an object is not a number",
6474
"data": {},
@@ -100,6 +110,11 @@
100110
"data": "foo",
101111
"valid": true
102112
},
113+
{
114+
"description": "a string is still a string, even if it looks like a number",
115+
"data": "1",
116+
"valid": true
117+
},
103118
{
104119
"description": "an object is not a string",
105120
"data": {},

0 commit comments

Comments
 (0)