Skip to content

Add and modify uniqueItems tests #525

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 2 commits into from
Nov 3, 2021
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
20 changes: 20 additions & 0 deletions tests/draft-next/uniqueItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"data": [1, 1],
"valid": false
},
{
"description": "non-unique array of more than two integers is invalid",
"data": [1, 2, 1],
"valid": false
},
{
"description": "numbers are unique if mathematically unequal",
"data": [1.0, 1.00, 1],
Expand All @@ -28,6 +33,16 @@
"data": [1, true],
"valid": true
},
{
"description": "unique array of strings is valid",
"data": ["foo", "bar", "baz"],
"valid": true
},
{
"description": "non-unique array of strings is invalid",
"data": ["foo", "bar", "foo"],
"valid": false
},
{
"description": "unique array of objects is valid",
"data": [{"foo": "bar"}, {"foo": "baz"}],
Expand Down Expand Up @@ -64,6 +79,11 @@
"data": [["foo"], ["foo"]],
"valid": false
},
{
"description": "non-unique array of more than two arrays is invalid",
"data": [["foo"], ["bar"], ["foo"]],
"valid": false
},
{
"description": "1 and true are unique",
"data": [1, true],
Expand Down
20 changes: 20 additions & 0 deletions tests/draft2019-09/uniqueItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"data": [1, 1],
"valid": false
},
{
"description": "non-unique array of more than two integers is invalid",
"data": [1, 2, 1],
"valid": false
},
{
"description": "numbers are unique if mathematically unequal",
"data": [1.0, 1.00, 1],
Expand All @@ -28,6 +33,16 @@
"data": [1, true],
"valid": true
},
{
"description": "unique array of strings is valid",
"data": ["foo", "bar", "baz"],
"valid": true
},
{
"description": "non-unique array of strings is invalid",
"data": ["foo", "bar", "foo"],
"valid": false
},
{
"description": "unique array of objects is valid",
"data": [{"foo": "bar"}, {"foo": "baz"}],
Expand Down Expand Up @@ -64,6 +79,11 @@
"data": [["foo"], ["foo"]],
"valid": false
},
{
"description": "non-unique array of more than two arrays is invalid",
"data": [["foo"], ["bar"], ["foo"]],
"valid": false
},
{
"description": "1 and true are unique",
"data": [1, true],
Expand Down
20 changes: 20 additions & 0 deletions tests/draft2020-12/uniqueItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"data": [1, 1],
"valid": false
},
{
"description": "non-unique array of more than two integers is invalid",
"data": [1, 2, 1],
"valid": false
},
{
"description": "numbers are unique if mathematically unequal",
"data": [1.0, 1.00, 1],
Expand All @@ -28,6 +33,16 @@
"data": [1, true],
"valid": true
},
{
"description": "unique array of strings is valid",
"data": ["foo", "bar", "baz"],
"valid": true
},
{
"description": "non-unique array of strings is invalid",
"data": ["foo", "bar", "foo"],
"valid": false
},
{
"description": "unique array of objects is valid",
"data": [{"foo": "bar"}, {"foo": "baz"}],
Expand Down Expand Up @@ -64,6 +79,11 @@
"data": [["foo"], ["foo"]],
"valid": false
},
{
"description": "non-unique array of more than two arrays is invalid",
"data": [["foo"], ["bar"], ["foo"]],
"valid": false
},
{
"description": "1 and true are unique",
"data": [1, true],
Expand Down
20 changes: 20 additions & 0 deletions tests/draft3/uniqueItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,26 @@
"data": [1, 1],
"valid": false
},
{
"description": "non-unique array of more than two integers is invalid",
"data": [1, 2, 1],
"valid": false
},
{
"description": "numbers are unique if mathematically unequal",
"data": [1.0, 1.00, 1],
"valid": false
},
{
"description": "unique array of strings is valid",
"data": ["foo", "bar", "baz"],
"valid": true
},
{
"description": "non-unique array of strings is invalid",
"data": ["foo", "bar", "foo"],
"valid": false
},
{
"description": "unique array of objects is valid",
"data": [{"foo": "bar"}, {"foo": "baz"}],
Expand Down Expand Up @@ -54,6 +69,11 @@
"data": [["foo"], ["foo"]],
"valid": false
},
{
"description": "non-unique array of more than two arrays is invalid",
"data": [["foo"], ["bar"], ["foo"]],
"valid": false
},
{
"description": "1 and true are unique",
"data": [1, true],
Expand Down
20 changes: 20 additions & 0 deletions tests/draft4/uniqueItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"data": [1, 1],
"valid": false
},
{
"description": "non-unique array of more than two integers is invalid",
"data": [1, 2, 1],
"valid": false
},
{
"description": "numbers are unique if mathematically unequal",
"data": [1.0, 1.00, 1],
Expand All @@ -28,6 +33,16 @@
"data": [1, true],
"valid": true
},
{
"description": "unique array of strings is valid",
"data": ["foo", "bar", "baz"],
"valid": true
},
{
"description": "non-unique array of strings is invalid",
"data": ["foo", "bar", "foo"],
"valid": false
},
{
"description": "unique array of objects is valid",
"data": [{"foo": "bar"}, {"foo": "baz"}],
Expand Down Expand Up @@ -64,6 +79,11 @@
"data": [["foo"], ["foo"]],
"valid": false
},
{
"description": "non-unique array of more than two arrays is invalid",
"data": [["foo"], ["bar"], ["foo"]],
"valid": false
},
{
"description": "1 and true are unique",
"data": [1, true],
Expand Down
20 changes: 20 additions & 0 deletions tests/draft6/uniqueItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"data": [1, 1],
"valid": false
},
{
"description": "non-unique array of more than two integers is invalid",
"data": [1, 2, 1],
"valid": false
},
{
"description": "numbers are unique if mathematically unequal",
"data": [1.0, 1.00, 1],
Expand All @@ -28,6 +33,16 @@
"data": [1, true],
"valid": true
},
{
"description": "unique array of strings is valid",
"data": ["foo", "bar", "baz"],
"valid": true
},
{
"description": "non-unique array of strings is invalid",
"data": ["foo", "bar", "foo"],
"valid": false
},
{
"description": "unique array of objects is valid",
"data": [{"foo": "bar"}, {"foo": "baz"}],
Expand Down Expand Up @@ -64,6 +79,11 @@
"data": [["foo"], ["foo"]],
"valid": false
},
{
"description": "non-unique array of more than two arrays is invalid",
"data": [["foo"], ["bar"], ["foo"]],
"valid": false
},
{
"description": "1 and true are unique",
"data": [1, true],
Expand Down
20 changes: 20 additions & 0 deletions tests/draft7/uniqueItems.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
"data": [1, 1],
"valid": false
},
{
"description": "non-unique array of more than two integers is invalid",
"data": [1, 2, 1],
"valid": false
},
{
"description": "numbers are unique if mathematically unequal",
"data": [1.0, 1.00, 1],
Expand All @@ -28,6 +33,16 @@
"data": [1, true],
"valid": true
},
{
"description": "unique array of strings is valid",
"data": ["foo", "bar", "baz"],
"valid": true
},
{
"description": "non-unique array of strings is invalid",
"data": ["foo", "bar", "foo"],
"valid": false
},
{
"description": "unique array of objects is valid",
"data": [{"foo": "bar"}, {"foo": "baz"}],
Expand Down Expand Up @@ -64,6 +79,11 @@
"data": [["foo"], ["foo"]],
"valid": false
},
{
"description": "non-unique array of more than two arrays is invalid",
"data": [["foo"], ["bar"], ["foo"]],
"valid": false
},
{
"description": "1 and true are unique",
"data": [1, true],
Expand Down