Skip to content

Commit e75ea94

Browse files
consolidate bignum and overflow tests in one file under optional/
an overflow result is an error, which may not be treated as valid: false by an implementation
1 parent 34e484c commit e75ea94

File tree

13 files changed

+29
-144
lines changed

13 files changed

+29
-144
lines changed

tests/draft-next/multipleOf.json

-11
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,5 @@
122122
"valid": false
123123
}
124124
]
125-
},
126-
{
127-
"description": "invalid instance should not raise error when float division = inf",
128-
"schema": {"type": "integer", "multipleOf": 0.123456789},
129-
"tests": [
130-
{
131-
"description": "always invalid, but naive implementations may raise an overflow error",
132-
"data": 1e308,
133-
"valid": false
134-
}
135-
]
136125
}
137126
]

tests/draft-next/optional/float-overflow.json

-13
This file was deleted.

tests/draft2019-09/multipleOf.json

-11
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,5 @@
122122
"valid": false
123123
}
124124
]
125-
},
126-
{
127-
"description": "invalid instance should not raise error when float division = inf",
128-
"schema": {"type": "integer", "multipleOf": 0.123456789},
129-
"tests": [
130-
{
131-
"description": "always invalid, but naive implementations may raise an overflow error",
132-
"data": 1e308,
133-
"valid": false
134-
}
135-
]
136125
}
137126
]

tests/draft2019-09/optional/float-overflow.json

-13
This file was deleted.

tests/draft2020-12/multipleOf.json

-11
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,5 @@
122122
"valid": false
123123
}
124124
]
125-
},
126-
{
127-
"description": "invalid instance should not raise error when float division = inf",
128-
"schema": {"type": "integer", "multipleOf": 0.123456789},
129-
"tests": [
130-
{
131-
"description": "always invalid, but naive implementations may raise an overflow error",
132-
"data": 1e308,
133-
"valid": false
134-
}
135-
]
136125
}
137126
]

tests/draft2020-12/optional/bignum.json

+29
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,34 @@
160160
"valid": false
161161
}
162162
]
163+
},
164+
{
165+
"description": "multipleOf with a very large dividend",
166+
"schema": {
167+
"multipleOf": 0.123456789
168+
},
169+
"tests": [
170+
{
171+
"description": "true result",
172+
"data": 1.23456789e+307,
173+
"valid": true
174+
},
175+
{
176+
"description": "false result",
177+
"data": 1e308,
178+
"valid": false
179+
}
180+
]
181+
},
182+
{
183+
"description": "all integers are multiples of 0.5, if overflow is handled",
184+
"schema": { "multipleOf": 0.5 },
185+
"tests": [
186+
{
187+
"description": "valid if optional overflow handling is implemented",
188+
"data": 1e308,
189+
"valid": true
190+
}
191+
]
163192
}
164193
]

tests/draft2020-12/optional/float-overflow.json

-13
This file was deleted.

tests/draft4/multipleOf.json

-11
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,5 @@
122122
"valid": false
123123
}
124124
]
125-
},
126-
{
127-
"description": "invalid instance should not raise error when float division = inf",
128-
"schema": {"type": "integer", "multipleOf": 0.123456789},
129-
"tests": [
130-
{
131-
"description": "always invalid, but naive implementations may raise an overflow error",
132-
"data": 1e308,
133-
"valid": false
134-
}
135-
]
136125
}
137126
]

tests/draft4/optional/float-overflow.json

-13
This file was deleted.

tests/draft6/multipleOf.json

-11
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,5 @@
122122
"valid": false
123123
}
124124
]
125-
},
126-
{
127-
"description": "invalid instance should not raise error when float division = inf",
128-
"schema": {"type": "integer", "multipleOf": 0.123456789},
129-
"tests": [
130-
{
131-
"description": "always invalid, but naive implementations may raise an overflow error",
132-
"data": 1e308,
133-
"valid": false
134-
}
135-
]
136125
}
137126
]

tests/draft6/optional/float-overflow.json

-13
This file was deleted.

tests/draft7/multipleOf.json

-11
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,5 @@
122122
"valid": false
123123
}
124124
]
125-
},
126-
{
127-
"description": "invalid instance should not raise error when float division = inf",
128-
"schema": {"type": "integer", "multipleOf": 0.123456789},
129-
"tests": [
130-
{
131-
"description": "always invalid, but naive implementations may raise an overflow error",
132-
"data": 1e308,
133-
"valid": false
134-
}
135-
]
136125
}
137126
]

tests/draft7/optional/float-overflow.json

-13
This file was deleted.

0 commit comments

Comments
 (0)