Skip to content

test false-exclusivity for max/min numbers #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/draft4/maximum.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@
}
]
},
{
"description": "maximum validation (explicit false exclusivity)",
"schema": {"maximum": 3.0, "exclusiveMaximum": false},
"tests": [
{
"description": "below the maximum is valid",
"data": 2.6,
"valid": true
},
{
"description": "boundary point is valid",
"data": 3.0,
"valid": true
},
{
"description": "above the maximum is invalid",
"data": 3.5,
"valid": false
},
{
"description": "ignores non-numbers",
"data": "x",
"valid": true
}
]
},
{
"description": "exclusiveMaximum validation",
"schema": {
Expand Down
26 changes: 26 additions & 0 deletions tests/draft4/minimum.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@
}
]
},
{
"description": "minimum validation (explicit false exclusivity)",
"schema": {"minimum": 1.1, "exclusiveMinimum": false},
"tests": [
{
"description": "above the minimum is valid",
"data": 2.6,
"valid": true
},
{
"description": "boundary point is valid",
"data": 1.1,
"valid": true
},
{
"description": "below the minimum is invalid",
"data": 0.6,
"valid": false
},
{
"description": "ignores non-numbers",
"data": "x",
"valid": true
}
]
},
{
"description": "exclusiveMinimum validation",
"schema": {
Expand Down