diff --git a/tests/draft2019-09/multipleOf.json b/tests/draft2019-09/multipleOf.json index ca3b7618..faa87cff 100644 --- a/tests/draft2019-09/multipleOf.json +++ b/tests/draft2019-09/multipleOf.json @@ -56,5 +56,16 @@ "valid": false } ] + }, + { + "description": "invalid instance should not raise error when float division = inf", + "schema": {"type": "integer", "multipleOf": 0.123456789}, + "tests": [ + { + "description": "always invalid, but naive implementations may raise an overflow error", + "data": 1e308, + "valid": false + } + ] } ] diff --git a/tests/draft2019-09/optional/float-overflow.json b/tests/draft2019-09/optional/float-overflow.json new file mode 100644 index 00000000..52ff9827 --- /dev/null +++ b/tests/draft2019-09/optional/float-overflow.json @@ -0,0 +1,13 @@ +[ + { + "description": "all integers are multiples of 0.5, if overflow is handled", + "schema": {"type": "integer", "multipleOf": 0.5}, + "tests": [ + { + "description": "valid if optional overflow handling is implemented", + "data": 1e308, + "valid": true + } + ] + } +] diff --git a/tests/draft4/multipleOf.json b/tests/draft4/multipleOf.json index ca3b7618..faa87cff 100644 --- a/tests/draft4/multipleOf.json +++ b/tests/draft4/multipleOf.json @@ -56,5 +56,16 @@ "valid": false } ] + }, + { + "description": "invalid instance should not raise error when float division = inf", + "schema": {"type": "integer", "multipleOf": 0.123456789}, + "tests": [ + { + "description": "always invalid, but naive implementations may raise an overflow error", + "data": 1e308, + "valid": false + } + ] } ] diff --git a/tests/draft4/optional/float-overflow.json b/tests/draft4/optional/float-overflow.json new file mode 100644 index 00000000..52ff9827 --- /dev/null +++ b/tests/draft4/optional/float-overflow.json @@ -0,0 +1,13 @@ +[ + { + "description": "all integers are multiples of 0.5, if overflow is handled", + "schema": {"type": "integer", "multipleOf": 0.5}, + "tests": [ + { + "description": "valid if optional overflow handling is implemented", + "data": 1e308, + "valid": true + } + ] + } +] diff --git a/tests/draft6/multipleOf.json b/tests/draft6/multipleOf.json index ca3b7618..faa87cff 100644 --- a/tests/draft6/multipleOf.json +++ b/tests/draft6/multipleOf.json @@ -56,5 +56,16 @@ "valid": false } ] + }, + { + "description": "invalid instance should not raise error when float division = inf", + "schema": {"type": "integer", "multipleOf": 0.123456789}, + "tests": [ + { + "description": "always invalid, but naive implementations may raise an overflow error", + "data": 1e308, + "valid": false + } + ] } ] diff --git a/tests/draft6/optional/float-overflow.json b/tests/draft6/optional/float-overflow.json new file mode 100644 index 00000000..52ff9827 --- /dev/null +++ b/tests/draft6/optional/float-overflow.json @@ -0,0 +1,13 @@ +[ + { + "description": "all integers are multiples of 0.5, if overflow is handled", + "schema": {"type": "integer", "multipleOf": 0.5}, + "tests": [ + { + "description": "valid if optional overflow handling is implemented", + "data": 1e308, + "valid": true + } + ] + } +] diff --git a/tests/draft7/multipleOf.json b/tests/draft7/multipleOf.json index ca3b7618..faa87cff 100644 --- a/tests/draft7/multipleOf.json +++ b/tests/draft7/multipleOf.json @@ -56,5 +56,16 @@ "valid": false } ] + }, + { + "description": "invalid instance should not raise error when float division = inf", + "schema": {"type": "integer", "multipleOf": 0.123456789}, + "tests": [ + { + "description": "always invalid, but naive implementations may raise an overflow error", + "data": 1e308, + "valid": false + } + ] } ] diff --git a/tests/draft7/optional/float-overflow.json b/tests/draft7/optional/float-overflow.json new file mode 100644 index 00000000..52ff9827 --- /dev/null +++ b/tests/draft7/optional/float-overflow.json @@ -0,0 +1,13 @@ +[ + { + "description": "all integers are multiples of 0.5, if overflow is handled", + "schema": {"type": "integer", "multipleOf": 0.5}, + "tests": [ + { + "description": "valid if optional overflow handling is implemented", + "data": 1e308, + "valid": true + } + ] + } +]