Skip to content

Commit

Permalink
Check that large integers are multiples of small multipleOf
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmior authored and jdesrosiers committed Mar 8, 2023
1 parent b59543f commit 8292706
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/draft-next/multipleOf.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,19 @@
"valid": false
}
]
},
{
"description": "small multiple of large integer",
"schema": {
"$schema": "https://json-schema.org/draft/next/schema",
"type": "integer", "multipleOf": 1e-8
},
"tests": [
{
"description": "any integer is a multiple of 1e-8",
"data": 12391239123,
"valid": true
}
]
}
]
14 changes: 14 additions & 0 deletions tests/draft2019-09/multipleOf.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,19 @@
"valid": false
}
]
},
{
"description": "small multiple of large integer",
"schema": {
"$schema": "https://json-schema.org/draft/2019-09/schema",
"type": "integer", "multipleOf": 1e-8
},
"tests": [
{
"description": "any integer is a multiple of 1e-8",
"data": 12391239123,
"valid": true
}
]
}
]
14 changes: 14 additions & 0 deletions tests/draft2020-12/multipleOf.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,19 @@
"valid": false
}
]
},
{
"description": "small multiple of large integer",
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "integer", "multipleOf": 1e-8
},
"tests": [
{
"description": "any integer is a multiple of 1e-8",
"data": 12391239123,
"valid": true
}
]
}
]
11 changes: 11 additions & 0 deletions tests/draft4/multipleOf.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,16 @@
"valid": false
}
]
},
{
"description": "small multiple of large integer",
"schema": {"type": "integer", "multipleOf": 1e-8},
"tests": [
{
"description": "any integer is a multiple of 1e-8",
"data": 12391239123,
"valid": true
}
]
}
]
11 changes: 11 additions & 0 deletions tests/draft6/multipleOf.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,16 @@
"valid": false
}
]
},
{
"description": "small multiple of large integer",
"schema": {"type": "integer", "multipleOf": 1e-8},
"tests": [
{
"description": "any integer is a multiple of 1e-8",
"data": 12391239123,
"valid": true
}
]
}
]
11 changes: 11 additions & 0 deletions tests/draft7/multipleOf.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,16 @@
"valid": false
}
]
},
{
"description": "small multiple of large integer",
"schema": {"type": "integer", "multipleOf": 1e-8},
"tests": [
{
"description": "any integer is a multiple of 1e-8",
"data": 12391239123,
"valid": true
}
]
}
]

0 comments on commit 8292706

Please sign in to comment.