diff --git a/README.md b/README.md index 88b65c99..b3a18fbe 100644 --- a/README.md +++ b/README.md @@ -76,15 +76,13 @@ Here is a single *test case*, containing one or more tests: ### Subdirectories Within Each Draft -There is currently only one additional subdirectory that may exist within each draft test directory. +There are currently four additional subdirectories that may exist within draft directories. +They are: -This is: - -1. `optional/`: Contains tests that are considered optional. - -Note, the `optional/` subdirectory today conflates many reasons why a test may be optional -- it may be because tests within a particular file are indeed not required by the specification but still potentially useful to an implementer, or it may be because tests within it only apply to programming languages with particular functionality (in -which case they are not truly optional in such a language). -In the future this directory structure will be made richer to reflect these differences more clearly. +1. `should/`: Contain tests which the specification designates as recommended behavior, either explicitly or otherwise clearly +2. `may/`: Contains tests which the specification designates as optional behavior, again explicitly or otherwise clearly +3. `additional/`: Contains additional tests or subdirectories whose applicability is left for implementations to confirm, either because they test additional vocabularies, apply only to certain languages or environments, or because the strength of their recommendation isn't clear from the specification +4. `alternatives/`: Contains additional subdirectories of tests which are mutually exclusive to each other. Implementations should often elect a single file within each directory, corresponding to the choice they have made. As a concrete example, the specification in draft 2020 dictates that given `{"$vocabulary": {"foo": false}, ...}`, all implementations regardless of whether they support `"foo"` should proceed with processing. The validation result, however, now depends on whether the implementation understands the vocabulary or not, so the `alternatives` directory has files for each possibility (though not including the third possibility that the implementation disregards the SHOULD and refuses to process the schema entirely). ## Using the Suite to Test a Validator Implementation @@ -153,7 +151,7 @@ If your implementation supports multiple versions, run the above procedure for e ``` 2. Test cases found within [special subdirectories](#subdirectories-within-each-draft) may require additional configuration to run. - In particular, tests within the `optional/format` subdirectory may require implementations to change the way they treat the `"format"`keyword (particularly on older drafts which did not have a notion of vocabularies). + In particular, tests within the `additional/format-assertion` subdirectory may require implementations to change the way they treat the `"format"`keyword (particularly on older drafts which did not have a notion of vocabularies). ### Invariants & Guarantees diff --git a/tests/draft-next/optional/bignum.json b/tests/draft-next/additional/bignum.json similarity index 100% rename from tests/draft-next/optional/bignum.json rename to tests/draft-next/additional/bignum.json diff --git a/tests/draft-next/optional/dependencies-compatibility.json b/tests/draft-next/additional/dependencies-compatibility.json similarity index 100% rename from tests/draft-next/optional/dependencies-compatibility.json rename to tests/draft-next/additional/dependencies-compatibility.json diff --git a/tests/draft-next/optional/float-overflow.json b/tests/draft-next/additional/float-overflow.json similarity index 100% rename from tests/draft-next/optional/float-overflow.json rename to tests/draft-next/additional/float-overflow.json diff --git a/tests/draft-next/optional/format/date-time.json b/tests/draft-next/additional/format-assertion/date-time.json similarity index 100% rename from tests/draft-next/optional/format/date-time.json rename to tests/draft-next/additional/format-assertion/date-time.json diff --git a/tests/draft-next/optional/format/date.json b/tests/draft-next/additional/format-assertion/date.json similarity index 100% rename from tests/draft-next/optional/format/date.json rename to tests/draft-next/additional/format-assertion/date.json diff --git a/tests/draft-next/optional/format/duration.json b/tests/draft-next/additional/format-assertion/duration.json similarity index 100% rename from tests/draft-next/optional/format/duration.json rename to tests/draft-next/additional/format-assertion/duration.json diff --git a/tests/draft-next/optional/format/email.json b/tests/draft-next/additional/format-assertion/email.json similarity index 100% rename from tests/draft-next/optional/format/email.json rename to tests/draft-next/additional/format-assertion/email.json diff --git a/tests/draft-next/optional/format/hostname.json b/tests/draft-next/additional/format-assertion/hostname.json similarity index 100% rename from tests/draft-next/optional/format/hostname.json rename to tests/draft-next/additional/format-assertion/hostname.json diff --git a/tests/draft-next/optional/format/idn-email.json b/tests/draft-next/additional/format-assertion/idn-email.json similarity index 100% rename from tests/draft-next/optional/format/idn-email.json rename to tests/draft-next/additional/format-assertion/idn-email.json diff --git a/tests/draft-next/optional/format/idn-hostname.json b/tests/draft-next/additional/format-assertion/idn-hostname.json similarity index 100% rename from tests/draft-next/optional/format/idn-hostname.json rename to tests/draft-next/additional/format-assertion/idn-hostname.json diff --git a/tests/draft-next/optional/format/ipv4.json b/tests/draft-next/additional/format-assertion/ipv4.json similarity index 100% rename from tests/draft-next/optional/format/ipv4.json rename to tests/draft-next/additional/format-assertion/ipv4.json diff --git a/tests/draft-next/optional/format/ipv6.json b/tests/draft-next/additional/format-assertion/ipv6.json similarity index 100% rename from tests/draft-next/optional/format/ipv6.json rename to tests/draft-next/additional/format-assertion/ipv6.json diff --git a/tests/draft-next/optional/format/iri-reference.json b/tests/draft-next/additional/format-assertion/iri-reference.json similarity index 100% rename from tests/draft-next/optional/format/iri-reference.json rename to tests/draft-next/additional/format-assertion/iri-reference.json diff --git a/tests/draft-next/optional/format/iri.json b/tests/draft-next/additional/format-assertion/iri.json similarity index 100% rename from tests/draft-next/optional/format/iri.json rename to tests/draft-next/additional/format-assertion/iri.json diff --git a/tests/draft-next/optional/format/json-pointer.json b/tests/draft-next/additional/format-assertion/json-pointer.json similarity index 100% rename from tests/draft-next/optional/format/json-pointer.json rename to tests/draft-next/additional/format-assertion/json-pointer.json diff --git a/tests/draft-next/optional/format/regex.json b/tests/draft-next/additional/format-assertion/regex.json similarity index 100% rename from tests/draft-next/optional/format/regex.json rename to tests/draft-next/additional/format-assertion/regex.json diff --git a/tests/draft-next/optional/format/relative-json-pointer.json b/tests/draft-next/additional/format-assertion/relative-json-pointer.json similarity index 100% rename from tests/draft-next/optional/format/relative-json-pointer.json rename to tests/draft-next/additional/format-assertion/relative-json-pointer.json diff --git a/tests/draft-next/optional/format/time.json b/tests/draft-next/additional/format-assertion/time.json similarity index 100% rename from tests/draft-next/optional/format/time.json rename to tests/draft-next/additional/format-assertion/time.json diff --git a/tests/draft-next/optional/format/uri-reference.json b/tests/draft-next/additional/format-assertion/uri-reference.json similarity index 100% rename from tests/draft-next/optional/format/uri-reference.json rename to tests/draft-next/additional/format-assertion/uri-reference.json diff --git a/tests/draft-next/optional/format/uri-template.json b/tests/draft-next/additional/format-assertion/uri-template.json similarity index 100% rename from tests/draft-next/optional/format/uri-template.json rename to tests/draft-next/additional/format-assertion/uri-template.json diff --git a/tests/draft-next/optional/format/uri.json b/tests/draft-next/additional/format-assertion/uri.json similarity index 100% rename from tests/draft-next/optional/format/uri.json rename to tests/draft-next/additional/format-assertion/uri.json diff --git a/tests/draft-next/optional/format/uuid.json b/tests/draft-next/additional/format-assertion/uuid.json similarity index 100% rename from tests/draft-next/optional/format/uuid.json rename to tests/draft-next/additional/format-assertion/uuid.json diff --git a/tests/draft-next/optional/non-bmp-regex.json b/tests/draft-next/additional/non-bmp-regex.json similarity index 100% rename from tests/draft-next/optional/non-bmp-regex.json rename to tests/draft-next/additional/non-bmp-regex.json diff --git a/tests/draft-next/optional/refOfUnknownKeyword.json b/tests/draft-next/additional/ref-to-unknown-keyword.json similarity index 100% rename from tests/draft-next/optional/refOfUnknownKeyword.json rename to tests/draft-next/additional/ref-to-unknown-keyword.json diff --git a/tests/draft2020-12/optional/format-assertion.json b/tests/draft-next/alternatives/false-vocabulary-format-assertion/is-known.json similarity index 87% rename from tests/draft2020-12/optional/format-assertion.json rename to tests/draft-next/alternatives/false-vocabulary-format-assertion/is-known.json index 03400370..64bc928e 100644 --- a/tests/draft2020-12/optional/format-assertion.json +++ b/tests/draft-next/alternatives/false-vocabulary-format-assertion/is-known.json @@ -1,8 +1,8 @@ [ { "description": "schema that uses custom metaschema with format-assertion: false", + "comment": "For implementations which support the format assertion vocabulary", "schema": { - "$id": "https://schema/using/format-assertion/false", "$schema": "http://localhost:1234/draft2020-12/format-assertion-false.json", "format": "ipv4" }, @@ -21,8 +21,8 @@ }, { "description": "schema that uses custom metaschema with format-assertion: true", + "comment": "For implementations which support the format assertion vocabulary", "schema": { - "$id": "https://schema/using/format-assertion/true", "$schema": "http://localhost:1234/draft2020-12/format-assertion-true.json", "format": "ipv4" }, diff --git a/tests/draft-next/alternatives/false-vocabulary-format-assertion/is-unknown.json b/tests/draft-next/alternatives/false-vocabulary-format-assertion/is-unknown.json new file mode 100644 index 00000000..76b8f93d --- /dev/null +++ b/tests/draft-next/alternatives/false-vocabulary-format-assertion/is-unknown.json @@ -0,0 +1,22 @@ +[ + { + "description": "schema that uses custom metaschema with format-assertion: false", + "comment": "For implementations which do not support the format assertion vocabulary", + "schema": { + "$schema": "http://localhost:1234/draft2020-12/format-assertion-false.json", + "format": "ipv4" + }, + "tests": [ + { + "description": "format-assertion: false: valid string", + "data": "127.0.0.1", + "valid": true + }, + { + "description": "format-assertion: false: invalid string", + "data": "not-an-ipv4", + "valid": true + } + ] + } +] diff --git a/tests/draft-next/optional/ecmascript-regex.json b/tests/draft-next/should/ecmascript-regex.json similarity index 100% rename from tests/draft-next/optional/ecmascript-regex.json rename to tests/draft-next/should/ecmascript-regex.json diff --git a/tests/draft2019-09/optional/bignum.json b/tests/draft2019-09/additional/bignum.json similarity index 100% rename from tests/draft2019-09/optional/bignum.json rename to tests/draft2019-09/additional/bignum.json diff --git a/tests/draft2019-09/optional/cross-draft.json b/tests/draft2019-09/additional/cross-draft.json similarity index 100% rename from tests/draft2019-09/optional/cross-draft.json rename to tests/draft2019-09/additional/cross-draft.json diff --git a/tests/draft2019-09/optional/dependencies-compatibility.json b/tests/draft2019-09/additional/dependencies-compatibility.json similarity index 100% rename from tests/draft2019-09/optional/dependencies-compatibility.json rename to tests/draft2019-09/additional/dependencies-compatibility.json diff --git a/tests/draft2019-09/optional/float-overflow.json b/tests/draft2019-09/additional/float-overflow.json similarity index 100% rename from tests/draft2019-09/optional/float-overflow.json rename to tests/draft2019-09/additional/float-overflow.json diff --git a/tests/draft2019-09/optional/format/date-time.json b/tests/draft2019-09/additional/format-assertion/date-time.json similarity index 100% rename from tests/draft2019-09/optional/format/date-time.json rename to tests/draft2019-09/additional/format-assertion/date-time.json diff --git a/tests/draft2019-09/optional/format/date.json b/tests/draft2019-09/additional/format-assertion/date.json similarity index 100% rename from tests/draft2019-09/optional/format/date.json rename to tests/draft2019-09/additional/format-assertion/date.json diff --git a/tests/draft2019-09/optional/format/duration.json b/tests/draft2019-09/additional/format-assertion/duration.json similarity index 100% rename from tests/draft2019-09/optional/format/duration.json rename to tests/draft2019-09/additional/format-assertion/duration.json diff --git a/tests/draft2019-09/optional/format/email.json b/tests/draft2019-09/additional/format-assertion/email.json similarity index 100% rename from tests/draft2019-09/optional/format/email.json rename to tests/draft2019-09/additional/format-assertion/email.json diff --git a/tests/draft2019-09/optional/format/hostname.json b/tests/draft2019-09/additional/format-assertion/hostname.json similarity index 100% rename from tests/draft2019-09/optional/format/hostname.json rename to tests/draft2019-09/additional/format-assertion/hostname.json diff --git a/tests/draft2019-09/optional/format/idn-email.json b/tests/draft2019-09/additional/format-assertion/idn-email.json similarity index 100% rename from tests/draft2019-09/optional/format/idn-email.json rename to tests/draft2019-09/additional/format-assertion/idn-email.json diff --git a/tests/draft2019-09/optional/format/idn-hostname.json b/tests/draft2019-09/additional/format-assertion/idn-hostname.json similarity index 100% rename from tests/draft2019-09/optional/format/idn-hostname.json rename to tests/draft2019-09/additional/format-assertion/idn-hostname.json diff --git a/tests/draft2019-09/optional/format/ipv4.json b/tests/draft2019-09/additional/format-assertion/ipv4.json similarity index 100% rename from tests/draft2019-09/optional/format/ipv4.json rename to tests/draft2019-09/additional/format-assertion/ipv4.json diff --git a/tests/draft2019-09/optional/format/ipv6.json b/tests/draft2019-09/additional/format-assertion/ipv6.json similarity index 100% rename from tests/draft2019-09/optional/format/ipv6.json rename to tests/draft2019-09/additional/format-assertion/ipv6.json diff --git a/tests/draft2019-09/optional/format/iri-reference.json b/tests/draft2019-09/additional/format-assertion/iri-reference.json similarity index 100% rename from tests/draft2019-09/optional/format/iri-reference.json rename to tests/draft2019-09/additional/format-assertion/iri-reference.json diff --git a/tests/draft2019-09/optional/format/iri.json b/tests/draft2019-09/additional/format-assertion/iri.json similarity index 100% rename from tests/draft2019-09/optional/format/iri.json rename to tests/draft2019-09/additional/format-assertion/iri.json diff --git a/tests/draft2019-09/optional/format/json-pointer.json b/tests/draft2019-09/additional/format-assertion/json-pointer.json similarity index 100% rename from tests/draft2019-09/optional/format/json-pointer.json rename to tests/draft2019-09/additional/format-assertion/json-pointer.json diff --git a/tests/draft2019-09/optional/format/regex.json b/tests/draft2019-09/additional/format-assertion/regex.json similarity index 100% rename from tests/draft2019-09/optional/format/regex.json rename to tests/draft2019-09/additional/format-assertion/regex.json diff --git a/tests/draft2019-09/optional/format/relative-json-pointer.json b/tests/draft2019-09/additional/format-assertion/relative-json-pointer.json similarity index 100% rename from tests/draft2019-09/optional/format/relative-json-pointer.json rename to tests/draft2019-09/additional/format-assertion/relative-json-pointer.json diff --git a/tests/draft2019-09/optional/format/time.json b/tests/draft2019-09/additional/format-assertion/time.json similarity index 100% rename from tests/draft2019-09/optional/format/time.json rename to tests/draft2019-09/additional/format-assertion/time.json diff --git a/tests/draft2019-09/optional/format/unknown.json b/tests/draft2019-09/additional/format-assertion/unknown.json similarity index 100% rename from tests/draft2019-09/optional/format/unknown.json rename to tests/draft2019-09/additional/format-assertion/unknown.json diff --git a/tests/draft2019-09/optional/format/uri-reference.json b/tests/draft2019-09/additional/format-assertion/uri-reference.json similarity index 100% rename from tests/draft2019-09/optional/format/uri-reference.json rename to tests/draft2019-09/additional/format-assertion/uri-reference.json diff --git a/tests/draft2019-09/optional/format/uri-template.json b/tests/draft2019-09/additional/format-assertion/uri-template.json similarity index 100% rename from tests/draft2019-09/optional/format/uri-template.json rename to tests/draft2019-09/additional/format-assertion/uri-template.json diff --git a/tests/draft2019-09/optional/format/uri.json b/tests/draft2019-09/additional/format-assertion/uri.json similarity index 100% rename from tests/draft2019-09/optional/format/uri.json rename to tests/draft2019-09/additional/format-assertion/uri.json diff --git a/tests/draft2019-09/optional/format/uuid.json b/tests/draft2019-09/additional/format-assertion/uuid.json similarity index 100% rename from tests/draft2019-09/optional/format/uuid.json rename to tests/draft2019-09/additional/format-assertion/uuid.json diff --git a/tests/draft2019-09/optional/non-bmp-regex.json b/tests/draft2019-09/additional/non-bmp-regex.json similarity index 100% rename from tests/draft2019-09/optional/non-bmp-regex.json rename to tests/draft2019-09/additional/non-bmp-regex.json diff --git a/tests/draft2019-09/optional/refOfUnknownKeyword.json b/tests/draft2019-09/additional/ref-to-unknown-keyword.json similarity index 100% rename from tests/draft2019-09/optional/refOfUnknownKeyword.json rename to tests/draft2019-09/additional/ref-to-unknown-keyword.json diff --git a/tests/draft2019-09/optional/ecmascript-regex.json b/tests/draft2019-09/should/ecmascript-regex.json similarity index 100% rename from tests/draft2019-09/optional/ecmascript-regex.json rename to tests/draft2019-09/should/ecmascript-regex.json diff --git a/tests/draft2020-12/optional/bignum.json b/tests/draft2020-12/additional/bignum.json similarity index 100% rename from tests/draft2020-12/optional/bignum.json rename to tests/draft2020-12/additional/bignum.json diff --git a/tests/draft2020-12/optional/cross-draft.json b/tests/draft2020-12/additional/cross-draft.json similarity index 100% rename from tests/draft2020-12/optional/cross-draft.json rename to tests/draft2020-12/additional/cross-draft.json diff --git a/tests/draft2020-12/optional/dependencies-compatibility.json b/tests/draft2020-12/additional/dependencies-compatibility.json similarity index 100% rename from tests/draft2020-12/optional/dependencies-compatibility.json rename to tests/draft2020-12/additional/dependencies-compatibility.json diff --git a/tests/draft2020-12/optional/float-overflow.json b/tests/draft2020-12/additional/float-overflow.json similarity index 100% rename from tests/draft2020-12/optional/float-overflow.json rename to tests/draft2020-12/additional/float-overflow.json diff --git a/tests/draft2020-12/optional/format/date-time.json b/tests/draft2020-12/additional/format-assertion/date-time.json similarity index 100% rename from tests/draft2020-12/optional/format/date-time.json rename to tests/draft2020-12/additional/format-assertion/date-time.json diff --git a/tests/draft2020-12/optional/format/date.json b/tests/draft2020-12/additional/format-assertion/date.json similarity index 100% rename from tests/draft2020-12/optional/format/date.json rename to tests/draft2020-12/additional/format-assertion/date.json diff --git a/tests/draft2020-12/optional/format/duration.json b/tests/draft2020-12/additional/format-assertion/duration.json similarity index 100% rename from tests/draft2020-12/optional/format/duration.json rename to tests/draft2020-12/additional/format-assertion/duration.json diff --git a/tests/draft2020-12/optional/format/email.json b/tests/draft2020-12/additional/format-assertion/email.json similarity index 100% rename from tests/draft2020-12/optional/format/email.json rename to tests/draft2020-12/additional/format-assertion/email.json diff --git a/tests/draft2020-12/optional/format/hostname.json b/tests/draft2020-12/additional/format-assertion/hostname.json similarity index 100% rename from tests/draft2020-12/optional/format/hostname.json rename to tests/draft2020-12/additional/format-assertion/hostname.json diff --git a/tests/draft2020-12/optional/format/idn-email.json b/tests/draft2020-12/additional/format-assertion/idn-email.json similarity index 100% rename from tests/draft2020-12/optional/format/idn-email.json rename to tests/draft2020-12/additional/format-assertion/idn-email.json diff --git a/tests/draft2020-12/optional/format/idn-hostname.json b/tests/draft2020-12/additional/format-assertion/idn-hostname.json similarity index 100% rename from tests/draft2020-12/optional/format/idn-hostname.json rename to tests/draft2020-12/additional/format-assertion/idn-hostname.json diff --git a/tests/draft2020-12/optional/format/ipv4.json b/tests/draft2020-12/additional/format-assertion/ipv4.json similarity index 100% rename from tests/draft2020-12/optional/format/ipv4.json rename to tests/draft2020-12/additional/format-assertion/ipv4.json diff --git a/tests/draft2020-12/optional/format/ipv6.json b/tests/draft2020-12/additional/format-assertion/ipv6.json similarity index 100% rename from tests/draft2020-12/optional/format/ipv6.json rename to tests/draft2020-12/additional/format-assertion/ipv6.json diff --git a/tests/draft2020-12/optional/format/iri-reference.json b/tests/draft2020-12/additional/format-assertion/iri-reference.json similarity index 100% rename from tests/draft2020-12/optional/format/iri-reference.json rename to tests/draft2020-12/additional/format-assertion/iri-reference.json diff --git a/tests/draft2020-12/optional/format/iri.json b/tests/draft2020-12/additional/format-assertion/iri.json similarity index 100% rename from tests/draft2020-12/optional/format/iri.json rename to tests/draft2020-12/additional/format-assertion/iri.json diff --git a/tests/draft2020-12/optional/format/json-pointer.json b/tests/draft2020-12/additional/format-assertion/json-pointer.json similarity index 100% rename from tests/draft2020-12/optional/format/json-pointer.json rename to tests/draft2020-12/additional/format-assertion/json-pointer.json diff --git a/tests/draft2020-12/optional/format/regex.json b/tests/draft2020-12/additional/format-assertion/regex.json similarity index 100% rename from tests/draft2020-12/optional/format/regex.json rename to tests/draft2020-12/additional/format-assertion/regex.json diff --git a/tests/draft2020-12/optional/format/relative-json-pointer.json b/tests/draft2020-12/additional/format-assertion/relative-json-pointer.json similarity index 100% rename from tests/draft2020-12/optional/format/relative-json-pointer.json rename to tests/draft2020-12/additional/format-assertion/relative-json-pointer.json diff --git a/tests/draft2020-12/optional/format/time.json b/tests/draft2020-12/additional/format-assertion/time.json similarity index 100% rename from tests/draft2020-12/optional/format/time.json rename to tests/draft2020-12/additional/format-assertion/time.json diff --git a/tests/draft2020-12/optional/format/unknown.json b/tests/draft2020-12/additional/format-assertion/unknown.json similarity index 100% rename from tests/draft2020-12/optional/format/unknown.json rename to tests/draft2020-12/additional/format-assertion/unknown.json diff --git a/tests/draft2020-12/optional/format/uri-reference.json b/tests/draft2020-12/additional/format-assertion/uri-reference.json similarity index 100% rename from tests/draft2020-12/optional/format/uri-reference.json rename to tests/draft2020-12/additional/format-assertion/uri-reference.json diff --git a/tests/draft2020-12/optional/format/uri-template.json b/tests/draft2020-12/additional/format-assertion/uri-template.json similarity index 100% rename from tests/draft2020-12/optional/format/uri-template.json rename to tests/draft2020-12/additional/format-assertion/uri-template.json diff --git a/tests/draft2020-12/optional/format/uri.json b/tests/draft2020-12/additional/format-assertion/uri.json similarity index 100% rename from tests/draft2020-12/optional/format/uri.json rename to tests/draft2020-12/additional/format-assertion/uri.json diff --git a/tests/draft2020-12/optional/format/uuid.json b/tests/draft2020-12/additional/format-assertion/uuid.json similarity index 100% rename from tests/draft2020-12/optional/format/uuid.json rename to tests/draft2020-12/additional/format-assertion/uuid.json diff --git a/tests/draft2020-12/optional/non-bmp-regex.json b/tests/draft2020-12/additional/non-bmp-regex.json similarity index 100% rename from tests/draft2020-12/optional/non-bmp-regex.json rename to tests/draft2020-12/additional/non-bmp-regex.json diff --git a/tests/draft2020-12/optional/refOfUnknownKeyword.json b/tests/draft2020-12/additional/ref-to-unknown-keyword.json similarity index 100% rename from tests/draft2020-12/optional/refOfUnknownKeyword.json rename to tests/draft2020-12/additional/ref-to-unknown-keyword.json diff --git a/tests/draft-next/optional/format-assertion.json b/tests/draft2020-12/alternatives/false-vocabulary-format-assertion/is-known.json similarity index 75% rename from tests/draft-next/optional/format-assertion.json rename to tests/draft2020-12/alternatives/false-vocabulary-format-assertion/is-known.json index ede922a2..64bc928e 100644 --- a/tests/draft-next/optional/format-assertion.json +++ b/tests/draft2020-12/alternatives/false-vocabulary-format-assertion/is-known.json @@ -1,9 +1,9 @@ [ { "description": "schema that uses custom metaschema with format-assertion: false", + "comment": "For implementations which support the format assertion vocabulary", "schema": { - "$id": "https://schema/using/format-assertion/false", - "$schema": "http://localhost:1234/draft-next/format-assertion-false.json", + "$schema": "http://localhost:1234/draft2020-12/format-assertion-false.json", "format": "ipv4" }, "tests": [ @@ -21,9 +21,9 @@ }, { "description": "schema that uses custom metaschema with format-assertion: true", + "comment": "For implementations which support the format assertion vocabulary", "schema": { - "$id": "https://schema/using/format-assertion/true", - "$schema": "http://localhost:1234/draft-next/format-assertion-true.json", + "$schema": "http://localhost:1234/draft2020-12/format-assertion-true.json", "format": "ipv4" }, "tests": [ diff --git a/tests/draft2020-12/alternatives/false-vocabulary-format-assertion/is-unknown.json b/tests/draft2020-12/alternatives/false-vocabulary-format-assertion/is-unknown.json new file mode 100644 index 00000000..76b8f93d --- /dev/null +++ b/tests/draft2020-12/alternatives/false-vocabulary-format-assertion/is-unknown.json @@ -0,0 +1,22 @@ +[ + { + "description": "schema that uses custom metaschema with format-assertion: false", + "comment": "For implementations which do not support the format assertion vocabulary", + "schema": { + "$schema": "http://localhost:1234/draft2020-12/format-assertion-false.json", + "format": "ipv4" + }, + "tests": [ + { + "description": "format-assertion: false: valid string", + "data": "127.0.0.1", + "valid": true + }, + { + "description": "format-assertion: false: invalid string", + "data": "not-an-ipv4", + "valid": true + } + ] + } +] diff --git a/tests/draft2020-12/optional/ecmascript-regex.json b/tests/draft2020-12/should/ecmascript-regex.json similarity index 99% rename from tests/draft2020-12/optional/ecmascript-regex.json rename to tests/draft2020-12/should/ecmascript-regex.json index 3ab9aafd..5f66e8f3 100644 --- a/tests/draft2020-12/optional/ecmascript-regex.json +++ b/tests/draft2020-12/should/ecmascript-regex.json @@ -1,6 +1,7 @@ [ { "description": "ECMA 262 regex $ does not match trailing newline", + "comment": "ยง6.4: ' These regular expressions SHOULD be valid according to the regular expression dialect described in ECMA-262, section 21.2.1'", "schema": { "type": "string", "pattern": "^abc$" diff --git a/tests/draft3/optional/bignum.json b/tests/draft3/additional/bignum.json similarity index 100% rename from tests/draft3/optional/bignum.json rename to tests/draft3/additional/bignum.json diff --git a/tests/draft3/optional/format/color.json b/tests/draft3/additional/format-assertion/color.json similarity index 100% rename from tests/draft3/optional/format/color.json rename to tests/draft3/additional/format-assertion/color.json diff --git a/tests/draft3/optional/format/date-time.json b/tests/draft3/additional/format-assertion/date-time.json similarity index 100% rename from tests/draft3/optional/format/date-time.json rename to tests/draft3/additional/format-assertion/date-time.json diff --git a/tests/draft3/optional/format/date.json b/tests/draft3/additional/format-assertion/date.json similarity index 100% rename from tests/draft3/optional/format/date.json rename to tests/draft3/additional/format-assertion/date.json diff --git a/tests/draft3/optional/format/email.json b/tests/draft3/additional/format-assertion/email.json similarity index 100% rename from tests/draft3/optional/format/email.json rename to tests/draft3/additional/format-assertion/email.json diff --git a/tests/draft3/optional/format/host-name.json b/tests/draft3/additional/format-assertion/host-name.json similarity index 100% rename from tests/draft3/optional/format/host-name.json rename to tests/draft3/additional/format-assertion/host-name.json diff --git a/tests/draft3/optional/format/ip-address.json b/tests/draft3/additional/format-assertion/ip-address.json similarity index 100% rename from tests/draft3/optional/format/ip-address.json rename to tests/draft3/additional/format-assertion/ip-address.json diff --git a/tests/draft3/optional/format/ipv6.json b/tests/draft3/additional/format-assertion/ipv6.json similarity index 100% rename from tests/draft3/optional/format/ipv6.json rename to tests/draft3/additional/format-assertion/ipv6.json diff --git a/tests/draft3/optional/format/regex.json b/tests/draft3/additional/format-assertion/regex.json similarity index 100% rename from tests/draft3/optional/format/regex.json rename to tests/draft3/additional/format-assertion/regex.json diff --git a/tests/draft3/optional/format/time.json b/tests/draft3/additional/format-assertion/time.json similarity index 100% rename from tests/draft3/optional/format/time.json rename to tests/draft3/additional/format-assertion/time.json diff --git a/tests/draft3/optional/format/uri.json b/tests/draft3/additional/format-assertion/uri.json similarity index 100% rename from tests/draft3/optional/format/uri.json rename to tests/draft3/additional/format-assertion/uri.json diff --git a/tests/draft3/optional/non-bmp-regex.json b/tests/draft3/additional/non-bmp-regex.json similarity index 100% rename from tests/draft3/optional/non-bmp-regex.json rename to tests/draft3/additional/non-bmp-regex.json diff --git a/tests/draft3/optional/zeroTerminatedFloats.json b/tests/draft3/additional/zero-terminated-floats.json similarity index 100% rename from tests/draft3/optional/zeroTerminatedFloats.json rename to tests/draft3/additional/zero-terminated-floats.json diff --git a/tests/draft3/optional/ecmascript-regex.json b/tests/draft3/should/ecmascript-regex.json similarity index 100% rename from tests/draft3/optional/ecmascript-regex.json rename to tests/draft3/should/ecmascript-regex.json diff --git a/tests/draft4/optional/bignum.json b/tests/draft4/additional/bignum.json similarity index 100% rename from tests/draft4/optional/bignum.json rename to tests/draft4/additional/bignum.json diff --git a/tests/draft4/optional/float-overflow.json b/tests/draft4/additional/float-overflow.json similarity index 100% rename from tests/draft4/optional/float-overflow.json rename to tests/draft4/additional/float-overflow.json diff --git a/tests/draft4/optional/format/date-time.json b/tests/draft4/additional/format-assertion/date-time.json similarity index 100% rename from tests/draft4/optional/format/date-time.json rename to tests/draft4/additional/format-assertion/date-time.json diff --git a/tests/draft4/optional/format/email.json b/tests/draft4/additional/format-assertion/email.json similarity index 100% rename from tests/draft4/optional/format/email.json rename to tests/draft4/additional/format-assertion/email.json diff --git a/tests/draft4/optional/format/hostname.json b/tests/draft4/additional/format-assertion/hostname.json similarity index 100% rename from tests/draft4/optional/format/hostname.json rename to tests/draft4/additional/format-assertion/hostname.json diff --git a/tests/draft4/optional/format/ipv4.json b/tests/draft4/additional/format-assertion/ipv4.json similarity index 100% rename from tests/draft4/optional/format/ipv4.json rename to tests/draft4/additional/format-assertion/ipv4.json diff --git a/tests/draft4/optional/format/ipv6.json b/tests/draft4/additional/format-assertion/ipv6.json similarity index 100% rename from tests/draft4/optional/format/ipv6.json rename to tests/draft4/additional/format-assertion/ipv6.json diff --git a/tests/draft4/optional/format/unknown.json b/tests/draft4/additional/format-assertion/unknown.json similarity index 100% rename from tests/draft4/optional/format/unknown.json rename to tests/draft4/additional/format-assertion/unknown.json diff --git a/tests/draft4/optional/format/uri.json b/tests/draft4/additional/format-assertion/uri.json similarity index 100% rename from tests/draft4/optional/format/uri.json rename to tests/draft4/additional/format-assertion/uri.json diff --git a/tests/draft4/optional/non-bmp-regex.json b/tests/draft4/additional/non-bmp-regex.json similarity index 100% rename from tests/draft4/optional/non-bmp-regex.json rename to tests/draft4/additional/non-bmp-regex.json diff --git a/tests/draft4/optional/zeroTerminatedFloats.json b/tests/draft4/additional/zero-terminated-floats.json similarity index 100% rename from tests/draft4/optional/zeroTerminatedFloats.json rename to tests/draft4/additional/zero-terminated-floats.json diff --git a/tests/draft4/optional/ecmascript-regex.json b/tests/draft4/should/ecmascript-regex.json similarity index 100% rename from tests/draft4/optional/ecmascript-regex.json rename to tests/draft4/should/ecmascript-regex.json diff --git a/tests/draft6/optional/bignum.json b/tests/draft6/additional/bignum.json similarity index 100% rename from tests/draft6/optional/bignum.json rename to tests/draft6/additional/bignum.json diff --git a/tests/draft6/optional/float-overflow.json b/tests/draft6/additional/float-overflow.json similarity index 100% rename from tests/draft6/optional/float-overflow.json rename to tests/draft6/additional/float-overflow.json diff --git a/tests/draft6/optional/format/date-time.json b/tests/draft6/additional/format-assertion/date-time.json similarity index 100% rename from tests/draft6/optional/format/date-time.json rename to tests/draft6/additional/format-assertion/date-time.json diff --git a/tests/draft6/optional/format/email.json b/tests/draft6/additional/format-assertion/email.json similarity index 100% rename from tests/draft6/optional/format/email.json rename to tests/draft6/additional/format-assertion/email.json diff --git a/tests/draft6/optional/format/hostname.json b/tests/draft6/additional/format-assertion/hostname.json similarity index 100% rename from tests/draft6/optional/format/hostname.json rename to tests/draft6/additional/format-assertion/hostname.json diff --git a/tests/draft6/optional/format/ipv4.json b/tests/draft6/additional/format-assertion/ipv4.json similarity index 100% rename from tests/draft6/optional/format/ipv4.json rename to tests/draft6/additional/format-assertion/ipv4.json diff --git a/tests/draft6/optional/format/ipv6.json b/tests/draft6/additional/format-assertion/ipv6.json similarity index 100% rename from tests/draft6/optional/format/ipv6.json rename to tests/draft6/additional/format-assertion/ipv6.json diff --git a/tests/draft6/optional/format/json-pointer.json b/tests/draft6/additional/format-assertion/json-pointer.json similarity index 100% rename from tests/draft6/optional/format/json-pointer.json rename to tests/draft6/additional/format-assertion/json-pointer.json diff --git a/tests/draft6/optional/format/unknown.json b/tests/draft6/additional/format-assertion/unknown.json similarity index 100% rename from tests/draft6/optional/format/unknown.json rename to tests/draft6/additional/format-assertion/unknown.json diff --git a/tests/draft6/optional/format/uri-reference.json b/tests/draft6/additional/format-assertion/uri-reference.json similarity index 100% rename from tests/draft6/optional/format/uri-reference.json rename to tests/draft6/additional/format-assertion/uri-reference.json diff --git a/tests/draft6/optional/format/uri-template.json b/tests/draft6/additional/format-assertion/uri-template.json similarity index 100% rename from tests/draft6/optional/format/uri-template.json rename to tests/draft6/additional/format-assertion/uri-template.json diff --git a/tests/draft6/optional/format/uri.json b/tests/draft6/additional/format-assertion/uri.json similarity index 100% rename from tests/draft6/optional/format/uri.json rename to tests/draft6/additional/format-assertion/uri.json diff --git a/tests/draft6/optional/non-bmp-regex.json b/tests/draft6/additional/non-bmp-regex.json similarity index 100% rename from tests/draft6/optional/non-bmp-regex.json rename to tests/draft6/additional/non-bmp-regex.json diff --git a/tests/draft6/optional/ecmascript-regex.json b/tests/draft6/should/ecmascript-regex.json similarity index 100% rename from tests/draft6/optional/ecmascript-regex.json rename to tests/draft6/should/ecmascript-regex.json diff --git a/tests/draft7/optional/bignum.json b/tests/draft7/additional/bignum.json similarity index 100% rename from tests/draft7/optional/bignum.json rename to tests/draft7/additional/bignum.json diff --git a/tests/draft7/optional/cross-draft.json b/tests/draft7/additional/cross-draft.json similarity index 100% rename from tests/draft7/optional/cross-draft.json rename to tests/draft7/additional/cross-draft.json diff --git a/tests/draft7/optional/float-overflow.json b/tests/draft7/additional/float-overflow.json similarity index 100% rename from tests/draft7/optional/float-overflow.json rename to tests/draft7/additional/float-overflow.json diff --git a/tests/draft7/optional/format/date-time.json b/tests/draft7/additional/format-assertion/date-time.json similarity index 100% rename from tests/draft7/optional/format/date-time.json rename to tests/draft7/additional/format-assertion/date-time.json diff --git a/tests/draft7/optional/format/date.json b/tests/draft7/additional/format-assertion/date.json similarity index 100% rename from tests/draft7/optional/format/date.json rename to tests/draft7/additional/format-assertion/date.json diff --git a/tests/draft7/optional/format/email.json b/tests/draft7/additional/format-assertion/email.json similarity index 100% rename from tests/draft7/optional/format/email.json rename to tests/draft7/additional/format-assertion/email.json diff --git a/tests/draft7/optional/format/hostname.json b/tests/draft7/additional/format-assertion/hostname.json similarity index 100% rename from tests/draft7/optional/format/hostname.json rename to tests/draft7/additional/format-assertion/hostname.json diff --git a/tests/draft7/optional/format/idn-email.json b/tests/draft7/additional/format-assertion/idn-email.json similarity index 100% rename from tests/draft7/optional/format/idn-email.json rename to tests/draft7/additional/format-assertion/idn-email.json diff --git a/tests/draft7/optional/format/idn-hostname.json b/tests/draft7/additional/format-assertion/idn-hostname.json similarity index 100% rename from tests/draft7/optional/format/idn-hostname.json rename to tests/draft7/additional/format-assertion/idn-hostname.json diff --git a/tests/draft7/optional/format/ipv4.json b/tests/draft7/additional/format-assertion/ipv4.json similarity index 100% rename from tests/draft7/optional/format/ipv4.json rename to tests/draft7/additional/format-assertion/ipv4.json diff --git a/tests/draft7/optional/format/ipv6.json b/tests/draft7/additional/format-assertion/ipv6.json similarity index 100% rename from tests/draft7/optional/format/ipv6.json rename to tests/draft7/additional/format-assertion/ipv6.json diff --git a/tests/draft7/optional/format/iri-reference.json b/tests/draft7/additional/format-assertion/iri-reference.json similarity index 100% rename from tests/draft7/optional/format/iri-reference.json rename to tests/draft7/additional/format-assertion/iri-reference.json diff --git a/tests/draft7/optional/format/iri.json b/tests/draft7/additional/format-assertion/iri.json similarity index 100% rename from tests/draft7/optional/format/iri.json rename to tests/draft7/additional/format-assertion/iri.json diff --git a/tests/draft7/optional/format/json-pointer.json b/tests/draft7/additional/format-assertion/json-pointer.json similarity index 100% rename from tests/draft7/optional/format/json-pointer.json rename to tests/draft7/additional/format-assertion/json-pointer.json diff --git a/tests/draft7/optional/format/regex.json b/tests/draft7/additional/format-assertion/regex.json similarity index 100% rename from tests/draft7/optional/format/regex.json rename to tests/draft7/additional/format-assertion/regex.json diff --git a/tests/draft7/optional/format/relative-json-pointer.json b/tests/draft7/additional/format-assertion/relative-json-pointer.json similarity index 100% rename from tests/draft7/optional/format/relative-json-pointer.json rename to tests/draft7/additional/format-assertion/relative-json-pointer.json diff --git a/tests/draft7/optional/format/time.json b/tests/draft7/additional/format-assertion/time.json similarity index 100% rename from tests/draft7/optional/format/time.json rename to tests/draft7/additional/format-assertion/time.json diff --git a/tests/draft7/optional/format/unknown.json b/tests/draft7/additional/format-assertion/unknown.json similarity index 100% rename from tests/draft7/optional/format/unknown.json rename to tests/draft7/additional/format-assertion/unknown.json diff --git a/tests/draft7/optional/format/uri-reference.json b/tests/draft7/additional/format-assertion/uri-reference.json similarity index 100% rename from tests/draft7/optional/format/uri-reference.json rename to tests/draft7/additional/format-assertion/uri-reference.json diff --git a/tests/draft7/optional/format/uri-template.json b/tests/draft7/additional/format-assertion/uri-template.json similarity index 100% rename from tests/draft7/optional/format/uri-template.json rename to tests/draft7/additional/format-assertion/uri-template.json diff --git a/tests/draft7/optional/format/uri.json b/tests/draft7/additional/format-assertion/uri.json similarity index 100% rename from tests/draft7/optional/format/uri.json rename to tests/draft7/additional/format-assertion/uri.json diff --git a/tests/draft7/optional/non-bmp-regex.json b/tests/draft7/additional/non-bmp-regex.json similarity index 100% rename from tests/draft7/optional/non-bmp-regex.json rename to tests/draft7/additional/non-bmp-regex.json diff --git a/tests/draft7/alternatives/content/annotation.json b/tests/draft7/alternatives/content/annotation.json new file mode 100644 index 00000000..2cd1c7d6 --- /dev/null +++ b/tests/draft7/alternatives/content/annotation.json @@ -0,0 +1,77 @@ +[ + { + "description": "validation of string-encoded content based on media type", + "schema": { + "contentMediaType": "application/json" + }, + "tests": [ + { + "description": "a valid JSON document", + "data": "{\"foo\": \"bar\"}", + "valid": true + }, + { + "description": "an invalid JSON document", + "data": "{:}", + "valid": true + }, + { + "description": "ignores non-strings", + "data": 100, + "valid": true + } + ] + }, + { + "description": "validation of binary string-encoding", + "schema": { + "contentEncoding": "base64" + }, + "tests": [ + { + "description": "a valid base64 string", + "data": "eyJmb28iOiAiYmFyIn0K", + "valid": true + }, + { + "description": "an invalid base64 string (% is not a valid character)", + "data": "eyJmb28iOi%iYmFyIn0K", + "valid": true + }, + { + "description": "ignores non-strings", + "data": 100, + "valid": true + } + ] + }, + { + "description": "validation of binary-encoded media type documents", + "schema": { + "contentMediaType": "application/json", + "contentEncoding": "base64" + }, + "tests": [ + { + "description": "a valid base64-encoded JSON document", + "data": "eyJmb28iOiAiYmFyIn0K", + "valid": true + }, + { + "description": "a validly-encoded invalid JSON document", + "data": "ezp9Cg==", + "valid": true + }, + { + "description": "an invalid base64 string that is valid JSON", + "data": "{}", + "valid": true + }, + { + "description": "ignores non-strings", + "data": 100, + "valid": true + } + ] + } +] diff --git a/tests/draft7/optional/content.json b/tests/draft7/alternatives/content/assertion.json similarity index 100% rename from tests/draft7/optional/content.json rename to tests/draft7/alternatives/content/assertion.json diff --git a/tests/draft7/optional/ecmascript-regex.json b/tests/draft7/should/ecmascript-regex.json similarity index 100% rename from tests/draft7/optional/ecmascript-regex.json rename to tests/draft7/should/ecmascript-regex.json