Skip to content

Commit a5b459f

Browse files
committed
Make sure bignum cases have unique descriptions.
Fixes a minor inefficiency in draft3 where separate cases were used instead of just 2 tests.
1 parent b82b18c commit a5b459f

File tree

7 files changed

+25
-37
lines changed

7 files changed

+25
-37
lines changed

tests/draft-next/optional/bignum.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
{
46-
"description": "integer comparison",
46+
"description": "maximum integer comparison",
4747
"schema": { "maximum": 18446744073709551615 },
4848
"tests": [
4949
{
@@ -67,7 +67,7 @@
6767
]
6868
},
6969
{
70-
"description": "integer comparison",
70+
"description": "minimum integer comparison",
7171
"schema": { "minimum": -18446744073709551615 },
7272
"tests": [
7373
{

tests/draft2019-09/optional/bignum.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
{
46-
"description": "integer comparison",
46+
"description": "maximum integer comparison",
4747
"schema": { "maximum": 18446744073709551615 },
4848
"tests": [
4949
{
@@ -67,7 +67,7 @@
6767
]
6868
},
6969
{
70-
"description": "integer comparison",
70+
"description": "minimum integer comparison",
7171
"schema": { "minimum": -18446744073709551615 },
7272
"tests": [
7373
{

tests/draft2020-12/optional/bignum.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
{
46-
"description": "integer comparison",
46+
"description": "maximum integer comparison",
4747
"schema": { "maximum": 18446744073709551615 },
4848
"tests": [
4949
{
@@ -67,7 +67,7 @@
6767
]
6868
},
6969
{
70-
"description": "integer comparison",
70+
"description": "minimum integer comparison",
7171
"schema": { "minimum": -18446744073709551615 },
7272
"tests": [
7373
{

tests/draft3/optional/bignum.json

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,13 @@
11
[
22
{
33
"description": "integer",
4-
"schema": {"type": "integer"},
4+
"schema": { "type": "integer" },
55
"tests": [
66
{
77
"description": "a bignum is an integer",
88
"data": 12345678910111213141516171819202122232425262728293031,
99
"valid": true
10-
}
11-
]
12-
},
13-
{
14-
"description": "number",
15-
"schema": {"type": "number"},
16-
"tests": [
17-
{
18-
"description": "a bignum is a number",
19-
"data": 98249283749234923498293171823948729348710298301928331,
20-
"valid": true
21-
}
22-
]
23-
},
24-
{
25-
"description": "integer",
26-
"schema": {"type": "integer"},
27-
"tests": [
10+
},
2811
{
2912
"description": "a negative bignum is an integer",
3013
"data": -12345678910111213141516171819202122232425262728293031,
@@ -34,8 +17,13 @@
3417
},
3518
{
3619
"description": "number",
37-
"schema": {"type": "number"},
20+
"schema": { "type": "number" },
3821
"tests": [
22+
{
23+
"description": "a bignum is a number",
24+
"data": 98249283749234923498293171823948729348710298301928331,
25+
"valid": true
26+
},
3927
{
4028
"description": "a negative bignum is a number",
4129
"data": -98249283749234923498293171823948729348710298301928331,
@@ -45,7 +33,7 @@
4533
},
4634
{
4735
"description": "string",
48-
"schema": {"type": "string"},
36+
"schema": { "type": "string" },
4937
"tests": [
5038
{
5139
"description": "a bignum is not a string",
@@ -55,8 +43,8 @@
5543
]
5644
},
5745
{
58-
"description": "integer comparison",
59-
"schema": {"maximum": 18446744073709551615},
46+
"description": "maximum integer comparison",
47+
"schema": { "maximum": 18446744073709551615 },
6048
"tests": [
6149
{
6250
"description": "comparison works for high numbers",
@@ -80,8 +68,8 @@
8068
]
8169
},
8270
{
83-
"description": "integer comparison",
84-
"schema": {"minimum": -18446744073709551615},
71+
"description": "minimum integer comparison",
72+
"schema": { "minimum": -18446744073709551615 },
8573
"tests": [
8674
{
8775
"description": "comparison works for very negative numbers",

tests/draft4/optional/bignum.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
{
46-
"description": "integer comparison",
46+
"description": "maximum integer comparison",
4747
"schema": { "maximum": 18446744073709551615 },
4848
"tests": [
4949
{
@@ -68,7 +68,7 @@
6868
]
6969
},
7070
{
71-
"description": "integer comparison",
71+
"description": "minimum integer comparison",
7272
"schema": { "minimum": -18446744073709551615 },
7373
"tests": [
7474
{

tests/draft6/optional/bignum.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
{
46-
"description": "integer comparison",
46+
"description": "maximum integer comparison",
4747
"schema": { "maximum": 18446744073709551615 },
4848
"tests": [
4949
{
@@ -67,7 +67,7 @@
6767
]
6868
},
6969
{
70-
"description": "integer comparison",
70+
"description": "minimum integer comparison",
7171
"schema": { "minimum": -18446744073709551615 },
7272
"tests": [
7373
{

tests/draft7/optional/bignum.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
]
4444
},
4545
{
46-
"description": "integer comparison",
46+
"description": "maximum integer comparison",
4747
"schema": { "maximum": 18446744073709551615 },
4848
"tests": [
4949
{
@@ -67,7 +67,7 @@
6767
]
6868
},
6969
{
70-
"description": "integer comparison",
70+
"description": "minimum integer comparison",
7171
"schema": { "minimum": -18446744073709551615 },
7272
"tests": [
7373
{

0 commit comments

Comments
 (0)