From 1a4ea00149e70383506f24648bfb52a2278fe3f7 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Sat, 5 Sep 2020 07:55:55 -0400 Subject: Squashed 'json/' changes from fce9e9b3..21555a85 21555a85 Merge pull request #431 from ChALkeR/chalker/enum 87550ad6 Merge pull request #433 from notEthan/escaped_ref_in_def 57e31b49 refactor tests of escaped pointer refs to put ref'd schemas in definitions a21e4258 Add tests for objects in enum 8a129948 Remove invalid format:regex test; the spec doesn't mandate parsing correctness git-subtree-dir: json git-subtree-split: 21555a8540584447a9f8ea659accd0ce79bd36e5 --- tests/draft2019-09/enum.json | 10 ++++++++++ tests/draft2019-09/optional/ecmascript-regex.json | 11 ----------- tests/draft3/ref.json | 14 ++++++++------ tests/draft4/enum.json | 10 ++++++++++ tests/draft4/optional/ecmascript-regex.json | 11 ----------- tests/draft4/ref.json | 14 ++++++++------ tests/draft6/enum.json | 10 ++++++++++ tests/draft6/optional/ecmascript-regex.json | 11 ----------- tests/draft6/ref.json | 14 ++++++++------ tests/draft7/enum.json | 10 ++++++++++ tests/draft7/optional/ecmascript-regex.json | 11 ----------- tests/draft7/ref.json | 14 ++++++++------ 12 files changed, 72 insertions(+), 68 deletions(-) diff --git a/tests/draft2019-09/enum.json b/tests/draft2019-09/enum.json index 6844578..f085097 100644 --- a/tests/draft2019-09/enum.json +++ b/tests/draft2019-09/enum.json @@ -33,6 +33,16 @@ "description": "objects are deep compared", "data": {"foo": false}, "valid": false + }, + { + "description": "valid object matches", + "data": {"foo": 12}, + "valid": true + }, + { + "description": "extra properties in object is invalid", + "data": {"foo": 12, "boo": 42}, + "valid": false } ] }, diff --git a/tests/draft2019-09/optional/ecmascript-regex.json b/tests/draft2019-09/optional/ecmascript-regex.json index b9412e0..6ed6cbe 100644 --- a/tests/draft2019-09/optional/ecmascript-regex.json +++ b/tests/draft2019-09/optional/ecmascript-regex.json @@ -1,15 +1,4 @@ [ - { - "description": "ECMA 262 regex non-compliance", - "schema": { "format": "regex" }, - "tests": [ - { - "description": "ECMA 262 has no support for \\Z anchor from .NET", - "data": "^\\S(|(.|\\n)*\\S)\\Z", - "valid": false - } - ] - }, { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { diff --git a/tests/draft3/ref.json b/tests/draft3/ref.json index 74e963c..77b2947 100644 --- a/tests/draft3/ref.json +++ b/tests/draft3/ref.json @@ -75,13 +75,15 @@ { "description": "escaped pointer ref", "schema": { - "tilde~field": {"type": "integer"}, - "slash/field": {"type": "integer"}, - "percent%field": {"type": "integer"}, + "definitions": { + "tilde~field": {"type": "integer"}, + "slash/field": {"type": "integer"}, + "percent%field": {"type": "integer"} + }, "properties": { - "tilde": {"$ref": "#/tilde~0field"}, - "slash": {"$ref": "#/slash~1field"}, - "percent": {"$ref": "#/percent%25field"} + "tilde": {"$ref": "#/definitions/tilde~0field"}, + "slash": {"$ref": "#/definitions/slash~1field"}, + "percent": {"$ref": "#/definitions/percent%25field"} } }, "tests": [ diff --git a/tests/draft4/enum.json b/tests/draft4/enum.json index 6844578..f085097 100644 --- a/tests/draft4/enum.json +++ b/tests/draft4/enum.json @@ -33,6 +33,16 @@ "description": "objects are deep compared", "data": {"foo": false}, "valid": false + }, + { + "description": "valid object matches", + "data": {"foo": 12}, + "valid": true + }, + { + "description": "extra properties in object is invalid", + "data": {"foo": 12, "boo": 42}, + "valid": false } ] }, diff --git a/tests/draft4/optional/ecmascript-regex.json b/tests/draft4/optional/ecmascript-regex.json index b9412e0..6ed6cbe 100644 --- a/tests/draft4/optional/ecmascript-regex.json +++ b/tests/draft4/optional/ecmascript-regex.json @@ -1,15 +1,4 @@ [ - { - "description": "ECMA 262 regex non-compliance", - "schema": { "format": "regex" }, - "tests": [ - { - "description": "ECMA 262 has no support for \\Z anchor from .NET", - "data": "^\\S(|(.|\\n)*\\S)\\Z", - "valid": false - } - ] - }, { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { diff --git a/tests/draft4/ref.json b/tests/draft4/ref.json index fc3e94b..f88e963 100644 --- a/tests/draft4/ref.json +++ b/tests/draft4/ref.json @@ -75,13 +75,15 @@ { "description": "escaped pointer ref", "schema": { - "tilde~field": {"type": "integer"}, - "slash/field": {"type": "integer"}, - "percent%field": {"type": "integer"}, + "definitions": { + "tilde~field": {"type": "integer"}, + "slash/field": {"type": "integer"}, + "percent%field": {"type": "integer"} + }, "properties": { - "tilde": {"$ref": "#/tilde~0field"}, - "slash": {"$ref": "#/slash~1field"}, - "percent": {"$ref": "#/percent%25field"} + "tilde": {"$ref": "#/definitions/tilde~0field"}, + "slash": {"$ref": "#/definitions/slash~1field"}, + "percent": {"$ref": "#/definitions/percent%25field"} } }, "tests": [ diff --git a/tests/draft6/enum.json b/tests/draft6/enum.json index 6844578..f085097 100644 --- a/tests/draft6/enum.json +++ b/tests/draft6/enum.json @@ -33,6 +33,16 @@ "description": "objects are deep compared", "data": {"foo": false}, "valid": false + }, + { + "description": "valid object matches", + "data": {"foo": 12}, + "valid": true + }, + { + "description": "extra properties in object is invalid", + "data": {"foo": 12, "boo": 42}, + "valid": false } ] }, diff --git a/tests/draft6/optional/ecmascript-regex.json b/tests/draft6/optional/ecmascript-regex.json index b9412e0..6ed6cbe 100644 --- a/tests/draft6/optional/ecmascript-regex.json +++ b/tests/draft6/optional/ecmascript-regex.json @@ -1,15 +1,4 @@ [ - { - "description": "ECMA 262 regex non-compliance", - "schema": { "format": "regex" }, - "tests": [ - { - "description": "ECMA 262 has no support for \\Z anchor from .NET", - "data": "^\\S(|(.|\\n)*\\S)\\Z", - "valid": false - } - ] - }, { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { diff --git a/tests/draft6/ref.json b/tests/draft6/ref.json index 8eaba56..0138382 100644 --- a/tests/draft6/ref.json +++ b/tests/draft6/ref.json @@ -75,13 +75,15 @@ { "description": "escaped pointer ref", "schema": { - "tilde~field": {"type": "integer"}, - "slash/field": {"type": "integer"}, - "percent%field": {"type": "integer"}, + "definitions": { + "tilde~field": {"type": "integer"}, + "slash/field": {"type": "integer"}, + "percent%field": {"type": "integer"} + }, "properties": { - "tilde": {"$ref": "#/tilde~0field"}, - "slash": {"$ref": "#/slash~1field"}, - "percent": {"$ref": "#/percent%25field"} + "tilde": {"$ref": "#/definitions/tilde~0field"}, + "slash": {"$ref": "#/definitions/slash~1field"}, + "percent": {"$ref": "#/definitions/percent%25field"} } }, "tests": [ diff --git a/tests/draft7/enum.json b/tests/draft7/enum.json index 6844578..f085097 100644 --- a/tests/draft7/enum.json +++ b/tests/draft7/enum.json @@ -33,6 +33,16 @@ "description": "objects are deep compared", "data": {"foo": false}, "valid": false + }, + { + "description": "valid object matches", + "data": {"foo": 12}, + "valid": true + }, + { + "description": "extra properties in object is invalid", + "data": {"foo": 12, "boo": 42}, + "valid": false } ] }, diff --git a/tests/draft7/optional/ecmascript-regex.json b/tests/draft7/optional/ecmascript-regex.json index b9412e0..6ed6cbe 100644 --- a/tests/draft7/optional/ecmascript-regex.json +++ b/tests/draft7/optional/ecmascript-regex.json @@ -1,15 +1,4 @@ [ - { - "description": "ECMA 262 regex non-compliance", - "schema": { "format": "regex" }, - "tests": [ - { - "description": "ECMA 262 has no support for \\Z anchor from .NET", - "data": "^\\S(|(.|\\n)*\\S)\\Z", - "valid": false - } - ] - }, { "description": "ECMA 262 regex $ does not match trailing newline", "schema": { diff --git a/tests/draft7/ref.json b/tests/draft7/ref.json index 5a8602e..01ba9fa 100644 --- a/tests/draft7/ref.json +++ b/tests/draft7/ref.json @@ -75,13 +75,15 @@ { "description": "escaped pointer ref", "schema": { - "tilde~field": {"type": "integer"}, - "slash/field": {"type": "integer"}, - "percent%field": {"type": "integer"}, + "definitions": { + "tilde~field": {"type": "integer"}, + "slash/field": {"type": "integer"}, + "percent%field": {"type": "integer"} + }, "properties": { - "tilde": {"$ref": "#/tilde~0field"}, - "slash": {"$ref": "#/slash~1field"}, - "percent": {"$ref": "#/percent%25field"} + "tilde": {"$ref": "#/definitions/tilde~0field"}, + "slash": {"$ref": "#/definitions/slash~1field"}, + "percent": {"$ref": "#/definitions/percent%25field"} } }, "tests": [ -- cgit v1.2.1