Skip to content

Commit 0df96bc

Browse files
group tests to avoid duplicating test descriptions
1 parent 93293ef commit 0df96bc

File tree

6 files changed

+68
-142
lines changed

6 files changed

+68
-142
lines changed

tests/draft-future/optional/bignum.json

Lines changed: 11 additions & 23 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",
@@ -56,7 +44,7 @@
5644
},
5745
{
5846
"description": "integer comparison",
59-
"schema": {"maximum": 18446744073709551615},
47+
"schema": { "maximum": 18446744073709551615 },
6048
"tests": [
6149
{
6250
"description": "comparison works for high numbers",
@@ -80,7 +68,7 @@
8068
},
8169
{
8270
"description": "integer comparison",
83-
"schema": {"minimum": -18446744073709551615},
71+
"schema": { "minimum": -18446744073709551615 },
8472
"tests": [
8573
{
8674
"description": "comparison works for very negative numbers",

tests/draft2019-09/optional/bignum.json

Lines changed: 11 additions & 23 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",
@@ -56,7 +44,7 @@
5644
},
5745
{
5846
"description": "integer comparison",
59-
"schema": {"maximum": 18446744073709551615},
47+
"schema": { "maximum": 18446744073709551615 },
6048
"tests": [
6149
{
6250
"description": "comparison works for high numbers",
@@ -80,7 +68,7 @@
8068
},
8169
{
8270
"description": "integer comparison",
83-
"schema": {"minimum": -18446744073709551615},
71+
"schema": { "minimum": -18446744073709551615 },
8472
"tests": [
8573
{
8674
"description": "comparison works for very negative numbers",

tests/draft2020-12/optional/bignum.json

Lines changed: 11 additions & 23 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",
@@ -56,7 +44,7 @@
5644
},
5745
{
5846
"description": "integer comparison",
59-
"schema": {"maximum": 18446744073709551615},
47+
"schema": { "maximum": 18446744073709551615 },
6048
"tests": [
6149
{
6250
"description": "comparison works for high numbers",
@@ -80,7 +68,7 @@
8068
},
8169
{
8270
"description": "integer comparison",
83-
"schema": {"minimum": -18446744073709551615},
71+
"schema": { "minimum": -18446744073709551615 },
8472
"tests": [
8573
{
8674
"description": "comparison works for very negative numbers",

tests/draft4/optional/bignum.json

Lines changed: 13 additions & 27 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",
@@ -56,7 +44,7 @@
5644
},
5745
{
5846
"description": "integer comparison",
59-
"schema": {"maximum": 18446744073709551615},
47+
"schema": { "maximum": 18446744073709551615 },
6048
"tests": [
6149
{
6250
"description": "comparison works for high numbers",
@@ -68,8 +56,7 @@
6856
{
6957
"description": "float comparison with high precision",
7058
"schema": {
71-
"maximum": 972783798187987123879878123.18878137,
72-
"exclusiveMaximum": true
59+
"exclusiveMaximum": 972783798187987123879878123.18878137
7360
},
7461
"tests": [
7562
{
@@ -81,7 +68,7 @@
8168
},
8269
{
8370
"description": "integer comparison",
84-
"schema": {"minimum": -18446744073709551615},
71+
"schema": { "minimum": -18446744073709551615 },
8572
"tests": [
8673
{
8774
"description": "comparison works for very negative numbers",
@@ -93,8 +80,7 @@
9380
{
9481
"description": "float comparison with high precision on negative numbers",
9582
"schema": {
96-
"minimum": -972783798187987123879878123.18878137,
97-
"exclusiveMinimum": true
83+
"exclusiveMinimum": -972783798187987123879878123.18878137
9884
},
9985
"tests": [
10086
{

tests/draft6/optional/bignum.json

Lines changed: 11 additions & 23 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",
@@ -56,7 +44,7 @@
5644
},
5745
{
5846
"description": "integer comparison",
59-
"schema": {"maximum": 18446744073709551615},
47+
"schema": { "maximum": 18446744073709551615 },
6048
"tests": [
6149
{
6250
"description": "comparison works for high numbers",
@@ -80,7 +68,7 @@
8068
},
8169
{
8270
"description": "integer comparison",
83-
"schema": {"minimum": -18446744073709551615},
71+
"schema": { "minimum": -18446744073709551615 },
8472
"tests": [
8573
{
8674
"description": "comparison works for very negative numbers",

0 commit comments

Comments
 (0)