diff options
author | Julian Berman <Julian@GrayVines.com> | 2020-05-02 16:04:16 -0400 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2020-05-02 16:04:16 -0400 |
commit | f40e3aa7cd52d4da653f86f40fe3aeb55d872975 (patch) | |
tree | 7b8d00c02f7f6260ce43674ab1573825fb16adf6 /tests/draft4 | |
parent | d1a643b5fced470dfa44cdd60648ea678ddc29b2 (diff) | |
download | jsonschema-f40e3aa7cd52d4da653f86f40fe3aeb55d872975.tar.gz |
Squashed 'json/' changes from 71f55b36b..361620ecf
361620ecf [355] Move non-BMP pattern tests to optional
e1f870b1c Add "comment" to the tests
bc68a6b80 Merge pull request #332 from jdesrosiers/unevaluated-tests
ab9e3d5c5 2 is more than 1.
846dd7abd Draft 4 isn't the most widely used anymore thankfully.
16191632e A bit less informal language in the README.
6077b07e1 Update unevaluatedProperties and unevaluatedItems tests
git-subtree-dir: json
git-subtree-split: 361620ecf18b71883f8522cb4c7e95e3e0adcdce
Diffstat (limited to 'tests/draft4')
-rw-r--r-- | tests/draft4/optional/non-bmp-regex.json | 82 | ||||
-rw-r--r-- | tests/draft4/pattern.json | 41 | ||||
-rw-r--r-- | tests/draft4/patternProperties.json | 37 |
3 files changed, 82 insertions, 78 deletions
diff --git a/tests/draft4/optional/non-bmp-regex.json b/tests/draft4/optional/non-bmp-regex.json new file mode 100644 index 0000000..dd67af2 --- /dev/null +++ b/tests/draft4/optional/non-bmp-regex.json @@ -0,0 +1,82 @@ +[ + { + "description": "Proper UTF-16 surrogate pair handling: pattern", + "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", + "schema": { "pattern": "^🐲*$" }, + "tests": [ + { + "description": "matches empty", + "data": "", + "valid": true + }, + { + "description": "matches single", + "data": "🐲", + "valid": true + }, + { + "description": "matches two", + "data": "🐲🐲", + "valid": true + }, + { + "description": "doesn't match one", + "data": "🐉", + "valid": false + }, + { + "description": "doesn't match two", + "data": "🐉🐉", + "valid": false + }, + { + "description": "doesn't match one ASCII", + "data": "D", + "valid": false + }, + { + "description": "doesn't match two ASCII", + "data": "DD", + "valid": false + } + ] + }, + { + "description": "Proper UTF-16 surrogate pair handling: patternProperties", + "comment": "Optional because .Net doesn't correctly handle 32-bit Unicode characters", + "schema": { + "patternProperties": { + "^🐲*$": { + "type": "integer" + } + } + }, + "tests": [ + { + "description": "matches empty", + "data": { "": 1 }, + "valid": true + }, + { + "description": "matches single", + "data": { "🐲": 1 }, + "valid": true + }, + { + "description": "matches two", + "data": { "🐲🐲": 1 }, + "valid": true + }, + { + "description": "doesn't match one", + "data": { "🐲": "hello" }, + "valid": false + }, + { + "description": "doesn't match two", + "data": { "🐲🐲": "hello" }, + "valid": false + } + ] + } +] diff --git a/tests/draft4/pattern.json b/tests/draft4/pattern.json index 3c7e04c..92db0f9 100644 --- a/tests/draft4/pattern.json +++ b/tests/draft4/pattern.json @@ -55,46 +55,5 @@ "valid": true } ] - }, - { - "description": "non-BMP, checks for proper surrogate pair handling for UTF-16", - "schema": { "pattern": "^🐲*$" }, - "tests": [ - { - "description": "matches empty", - "data": "", - "valid": true - }, - { - "description": "matches single", - "data": "🐲", - "valid": true - }, - { - "description": "matches two", - "data": "🐲🐲", - "valid": true - }, - { - "description": "doesn't match one", - "data": "🐉", - "valid": false - }, - { - "description": "doesn't match two", - "data": "🐉🐉", - "valid": false - }, - { - "description": "doesn't match one ASCII", - "data": "D", - "valid": false - }, - { - "description": "doesn't match two ASCII", - "data": "DD", - "valid": false - } - ] } ] diff --git a/tests/draft4/patternProperties.json b/tests/draft4/patternProperties.json index bdda1d7..5f741df 100644 --- a/tests/draft4/patternProperties.json +++ b/tests/draft4/patternProperties.json @@ -116,42 +116,5 @@ "valid": false } ] - }, - { - "description": "non-BMP, checks for proper surrogate pair handling for UTF-16", - "schema": { - "patternProperties": { - "^🐲*$": { - "type": "integer" - } - } - }, - "tests": [ - { - "description": "matches empty", - "data": { "": 1 }, - "valid": true - }, - { - "description": "matches single", - "data": { "🐲": 1 }, - "valid": true - }, - { - "description": "matches two", - "data": { "🐲🐲": 1 }, - "valid": true - }, - { - "description": "doesn't match one", - "data": { "🐲": "hello" }, - "valid": false - }, - { - "description": "doesn't match two", - "data": { "🐲🐲": "hello" }, - "valid": false - } - ] } ] |