Skip to content

Commit

Permalink
Squashed 'json/' changes from 329efe59c..9263b5250
Browse files Browse the repository at this point in the history
9263b5250 Merge pull request #525 from DrGFreeman/524-uniqueItems-tests
2c5368886 Add tests instead of modifying existing tests
de84a59c5 Add and modify uniqueItems tests

git-subtree-dir: json
git-subtree-split: 9263b52500a6688ba02181ef2299ec4a894b589e
  • Loading branch information
Julian committed Nov 3, 2021
1 parent ddef3b4 commit c9b7436
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 0 deletions.
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

0 comments on commit c9b7436

Please sign in to comment.