diff options
author | Julian Berman <Julian@GrayVines.com> | 2020-05-02 16:04:17 -0400 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2020-05-02 16:04:17 -0400 |
commit | 1fae89b3cec5c018e86a8aa14f394543fd18d2d6 (patch) | |
tree | 091aeb6515aab8f55ea5371d15547ba97ecad204 /json/tests/draft3 | |
parent | 8a0563cd9ccedd0ee46b84f8e8e386bcd0e1f51e (diff) | |
parent | f40e3aa7cd52d4da653f86f40fe3aeb55d872975 (diff) | |
download | jsonschema-1fae89b3cec5c018e86a8aa14f394543fd18d2d6.tar.gz |
Merge commit 'f40e3aa7cd52d4da653f86f40fe3aeb55d872975'
* commit 'f40e3aa7cd52d4da653f86f40fe3aeb55d872975':
Squashed 'json/' changes from 71f55b36b..361620ecf
Diffstat (limited to 'json/tests/draft3')
-rw-r--r-- | json/tests/draft3/optional/non-bmp-regex.json | 82 | ||||
-rw-r--r-- | json/tests/draft3/pattern.json | 41 | ||||
-rw-r--r-- | json/tests/draft3/patternProperties.json | 37 |
3 files changed, 82 insertions, 78 deletions
diff --git a/json/tests/draft3/optional/non-bmp-regex.json b/json/tests/draft3/optional/non-bmp-regex.json new file mode 100644 index 0000000..dd67af2 --- /dev/null +++ b/json/tests/draft3/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/json/tests/draft3/pattern.json b/json/tests/draft3/pattern.json index 3c7e04c..92db0f9 100644 --- a/json/tests/draft3/pattern.json +++ b/json/tests/draft3/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/json/tests/draft3/patternProperties.json b/json/tests/draft3/patternProperties.json index 3a39983..2ca9aae 100644 --- a/json/tests/draft3/patternProperties.json +++ b/json/tests/draft3/patternProperties.json @@ -111,42 +111,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 - } - ] } ] |