From 76c6e3cafe6ace1aaa9d3ec3c5cc4ddaafd05de0 Mon Sep 17 00:00:00 2001 From: "A.J. Stein" Date: Sat, 10 Jun 2023 00:23:12 -0400 Subject: [PATCH] Remove narrow and open tests for flag elements. The reason these tests exist only for field is they have a target. In current Metaschema syntax, allowed-value for flag, because of the virtue of how it works, does not have a target (it is always implied '.') and some the variety of non-dot targets, even if implied, are not possible like they are for field. --- .../json-value_flag_constrained-narrow.json | 72 ------------------- ...lue_flag_constrained-narrow_metaschema.xml | 39 ---------- .../json-value_flag_constrained-sortof.json | 72 ------------------- ...lue_flag_constrained-sortof_metaschema.xml | 38 ---------- 4 files changed, 221 deletions(-) delete mode 100644 test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-narrow.json delete mode 100644 test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-narrow_metaschema.xml delete mode 100644 test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-sortof.json delete mode 100644 test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-sortof_metaschema.xml diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-narrow.json b/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-narrow.json deleted file mode 100644 index 2fdb6e277..000000000 --- a/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-narrow.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://csrc.nist.gov/ns/metaschema-tests/0.1/json-value_flag_constrained-narrow-schema.json", - "$comment": "JSON value testing mini metaschema: JSON Schema", - "type": "object", - "definitions": { - "json-value_flag_constrained-narrow-json-value_flag_constrained-narrow:root": { - "title": "Root", - "description": "Root root root.", - "$id": "#assembly_json-value_flag_constrained-narrow_root", - "type": "object", - "properties": { - "constrained-narrow": { - "$ref": "#field_json-value_flag_constrained-narrow_constrained-narrow" - } - }, - "additionalProperties": false - }, - "json-value_flag_constrained-narrow-json-value_flag_constrained-narrow:constrained-narrow": { - "title": "Constrained narrow", - "description": "Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope.", - "$id": "#field_json-value_flag_constrained-narrow_constrained-narrow", - "type": "object", - "properties": { - "some": { - "title": "Some Flag", - "description": "Some flag some flag some flag.", - "allOf": [ - { - "$ref": "#/definitions/StringDatatype" - }, - { - "enum": [ - "one", - "two", - "three", - "four" - ] - } - ] - }, - "token-value": { - "$ref": "#/definitions/TokenDatatype" - } - }, - "required": [ - "token-value" - ], - "additionalProperties": false - }, - "StringDatatype": { - "description": "A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9, U+10, U+32 or [ \n\t]+", - "type": "string", - "pattern": "^\\S(.*\\S)?$" - }, - "TokenDatatype": { - "description": "A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition. https://www.w3.org/TR/xmlschema11-2/#NCName.", - "type": "string", - "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" - } - }, - "properties": { - "root": { - "$ref": "#assembly_json-value_flag_constrained-narrow_root" - } - }, - "required": [ - "root" - ], - "additionalProperties": false, - "maxProperties": 1 -} \ No newline at end of file diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-narrow_metaschema.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-narrow_metaschema.xml deleted file mode 100644 index abd6386ca..000000000 --- a/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-narrow_metaschema.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - JSON value testing mini metaschema - 0.1 - json-value_flag_constrained-narrow - http://csrc.nist.gov/ns/metaschema-tests/1.0 - http://csrc.nist.gov/ns/metaschema-tests - - Root - Root root root. - root - - - - - - - Constrained narrow - Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope. - token-value - - Some Flag - Some flag some flag some flag. - - - - - - - - - - - diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-sortof.json b/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-sortof.json deleted file mode 100644 index 4bb7e9527..000000000 --- a/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-sortof.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://csrc.nist.gov/ns/metaschema-tests/0.1/json-value_flag_constrained_sortof-schema.json", - "$comment": "JSON value testing mini metaschema: JSON Schema", - "type": "object", - "definitions": { - "json-value_flag_constrained_sortof-json-value_flag_constrained_sortof:root": { - "title": "Root", - "description": "Root root root.", - "$id": "#assembly_json-value_flag_constrained_sortof_root", - "type": "object", - "properties": { - "constrained-sortof": { - "$ref": "#field_json-value_flag_constrained_sortof_constrained-sortof" - } - }, - "additionalProperties": false - }, - "json-value_flag_constrained_sortof-json-value_flag_constrained_sortof:constrained-sortof": { - "title": "Constrained, sort of", - "description": "Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope.", - "$id": "#field_json-value_flag_constrained_sortof_constrained-sortof", - "type": "object", - "properties": { - "some": { - "title": "Some Flag", - "description": "Some flag some flag some flag.", - "anyOf": [ - { - "$ref": "#/definitions/StringDatatype" - }, - { - "enum": [ - "one", - "two", - "three", - "four" - ] - } - ] - }, - "token-value": { - "$ref": "#/definitions/TokenDatatype" - } - }, - "required": [ - "token-value" - ], - "additionalProperties": false - }, - "StringDatatype": { - "description": "A non-empty string with leading and trailing whitespace disallowed. Whitespace is: U+9, U+10, U+32 or [ \n\t]+", - "type": "string", - "pattern": "^\\S(.*\\S)?$" - }, - "TokenDatatype": { - "description": "A non-colonized name as defined by XML Schema Part 2: Datatypes Second Edition. https://www.w3.org/TR/xmlschema11-2/#NCName.", - "type": "string", - "pattern": "^(\\p{L}|_)(\\p{L}|\\p{N}|[.\\-_])*$" - } - }, - "properties": { - "root": { - "$ref": "#assembly_json-value_flag_constrained_sortof_root" - } - }, - "required": [ - "root" - ], - "additionalProperties": false, - "maxProperties": 1 -} \ No newline at end of file diff --git a/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-sortof_metaschema.xml b/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-sortof_metaschema.xml deleted file mode 100644 index cb3e1f4e7..000000000 --- a/test-suite/metaschema-xspec/json-schema-gen/json-value_flag_constrained-sortof_metaschema.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - JSON value testing mini metaschema - 0.1 - json-value_flag_constrained_sortof - http://csrc.nist.gov/ns/metaschema-tests/1.0 - http://csrc.nist.gov/ns/metaschema-tests - - Root - Root root root. - root - - - - - - Constrained, sort of - Although allow-other is 'no' an enumeration can't be given in the JSON Schema since it targets a qualified set (only a subset) of the elements in scope. - token-value - - Some Flag - Some flag some flag some flag. - - - - - - - - - - -