Skip to content

Commit daf1916

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 ddf325d commit daf1916

File tree

13 files changed

+29
-144
lines changed

13 files changed

+29
-144
lines changed

Diff for: 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
]

Diff for: tests/draft-next/optional/float-overflow.json

-13
This file was deleted.

Diff for: 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
]

Diff for: tests/draft2019-09/optional/float-overflow.json

-13
This file was deleted.

Diff for: 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
]

Diff for: tests/draft2020-12/optional/bignum.json

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

Diff for: tests/draft2020-12/optional/float-overflow.json

-13
This file was deleted.

Diff for: 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
]

Diff for: tests/draft4/optional/float-overflow.json

-13
This file was deleted.

Diff for: 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
]

Diff for: tests/draft6/optional/float-overflow.json

-13
This file was deleted.

Diff for: 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
]

Diff for: tests/draft7/optional/float-overflow.json

-13
This file was deleted.

0 commit comments

Comments
 (0)