From ad94cacc6968eb2d1bfe500741efb558b70059cf Mon Sep 17 00:00:00 2001 From: Oleg Date: Mon, 3 Feb 2025 21:22:36 +0400 Subject: [PATCH 1/3] Add test cases for other valid label separators in IDN hostnames --- .../optional/format/idn-hostname.json | 30 +++++++++++++++++++ .../optional/format/idn-hostname.json | 30 +++++++++++++++++++ .../optional/format/idn-hostname.json | 30 +++++++++++++++++++ .../draft7/optional/format/idn-hostname.json | 30 +++++++++++++++++++ 4 files changed, 120 insertions(+) diff --git a/tests/draft-next/optional/format/idn-hostname.json b/tests/draft-next/optional/format/idn-hostname.json index fa348fe6..27a6f623 100644 --- a/tests/draft-next/optional/format/idn-hostname.json +++ b/tests/draft-next/optional/format/idn-hostname.json @@ -336,6 +336,36 @@ "description": "single dot", "data": ".", "valid": false + }, + { + "description": "single ideographic full stop (RFC 3490#3.1)", + "data": "\u3002", + "valid": false + }, + { + "description": "single fullwidth full stop (RFC 3490#3.1)", + "data": "\uff0e", + "valid": false + }, + { + "description": "single halfwidth ideographic full stop (RFC 3490#3.1)", + "data": "\uff61", + "valid": false + }, + { + "description": "ideographic full stop (RFC 3490#3.1) as label separator", + "data": "a\u3002b", + "valid": true + }, + { + "description": "fullwidth full stop (RFC 3490#3.1) as label separator", + "data": "a\uff0eb", + "valid": true + }, + { + "description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator", + "data": "a\uff61b", + "valid": true } ] } diff --git a/tests/draft2019-09/optional/format/idn-hostname.json b/tests/draft2019-09/optional/format/idn-hostname.json index 3e0b6497..01f9c597 100644 --- a/tests/draft2019-09/optional/format/idn-hostname.json +++ b/tests/draft2019-09/optional/format/idn-hostname.json @@ -336,6 +336,36 @@ "description": "single dot", "data": ".", "valid": false + }, + { + "description": "single ideographic full stop (RFC 3490#3.1)", + "data": "\u3002", + "valid": false + }, + { + "description": "single fullwidth full stop (RFC 3490#3.1)", + "data": "\uff0e", + "valid": false + }, + { + "description": "single halfwidth ideographic full stop (RFC 3490#3.1)", + "data": "\uff61", + "valid": false + }, + { + "description": "ideographic full stop (RFC 3490#3.1) as label separator", + "data": "a\u3002b", + "valid": true + }, + { + "description": "fullwidth full stop (RFC 3490#3.1) as label separator", + "data": "a\uff0eb", + "valid": true + }, + { + "description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator", + "data": "a\uff61b", + "valid": true } ] } diff --git a/tests/draft2020-12/optional/format/idn-hostname.json b/tests/draft2020-12/optional/format/idn-hostname.json index eb91b5a4..eafa4d9d 100644 --- a/tests/draft2020-12/optional/format/idn-hostname.json +++ b/tests/draft2020-12/optional/format/idn-hostname.json @@ -336,6 +336,36 @@ "description": "single dot", "data": ".", "valid": false + }, + { + "description": "single ideographic full stop (RFC 3490#3.1)", + "data": "\u3002", + "valid": false + }, + { + "description": "single fullwidth full stop (RFC 3490#3.1)", + "data": "\uff0e", + "valid": false + }, + { + "description": "single halfwidth ideographic full stop (RFC 3490#3.1)", + "data": "\uff61", + "valid": false + }, + { + "description": "ideographic full stop (RFC 3490#3.1) as label separator", + "data": "a\u3002b", + "valid": true + }, + { + "description": "fullwidth full stop (RFC 3490#3.1) as label separator", + "data": "a\uff0eb", + "valid": true + }, + { + "description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator", + "data": "a\uff61b", + "valid": true } ] } diff --git a/tests/draft7/optional/format/idn-hostname.json b/tests/draft7/optional/format/idn-hostname.json index 0fe07e1e..1db070ec 100644 --- a/tests/draft7/optional/format/idn-hostname.json +++ b/tests/draft7/optional/format/idn-hostname.json @@ -328,6 +328,36 @@ "description": "single dot", "data": ".", "valid": false + }, + { + "description": "single ideographic full stop (RFC 3490#3.1)", + "data": "\u3002", + "valid": false + }, + { + "description": "single fullwidth full stop (RFC 3490#3.1)", + "data": "\uff0e", + "valid": false + }, + { + "description": "single halfwidth ideographic full stop (RFC 3490#3.1)", + "data": "\uff61", + "valid": false + }, + { + "description": "ideographic full stop (RFC 3490#3.1) as label separator", + "data": "a\u3002b", + "valid": true + }, + { + "description": "fullwidth full stop (RFC 3490#3.1) as label separator", + "data": "a\uff0eb", + "valid": true + }, + { + "description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator", + "data": "a\uff61b", + "valid": true } ] } From ce9f68cae4a429906ccf5afe8a37bb8fa5ccdb3d Mon Sep 17 00:00:00 2001 From: Oleg Date: Wed, 5 Feb 2025 21:29:15 +0400 Subject: [PATCH 2/3] Add link to rfc and quote --- tests/draft-next/optional/format/idn-hostname.json | 3 +++ tests/draft2019-09/optional/format/idn-hostname.json | 3 +++ tests/draft2020-12/optional/format/idn-hostname.json | 3 +++ tests/draft7/optional/format/idn-hostname.json | 3 +++ 4 files changed, 12 insertions(+) diff --git a/tests/draft-next/optional/format/idn-hostname.json b/tests/draft-next/optional/format/idn-hostname.json index 27a6f623..7b48437b 100644 --- a/tests/draft-next/optional/format/idn-hostname.json +++ b/tests/draft-next/optional/format/idn-hostname.json @@ -1,6 +1,9 @@ [ { "description": "validation of internationalized host names", + "specification": [ + {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} + ], "schema": { "$schema": "https://json-schema.org/draft/next/schema", "format": "idn-hostname" diff --git a/tests/draft2019-09/optional/format/idn-hostname.json b/tests/draft2019-09/optional/format/idn-hostname.json index 01f9c597..2e88e7f9 100644 --- a/tests/draft2019-09/optional/format/idn-hostname.json +++ b/tests/draft2019-09/optional/format/idn-hostname.json @@ -1,6 +1,9 @@ [ { "description": "validation of internationalized host names", + "specification": [ + {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} + ], "schema": { "$schema": "https://json-schema.org/draft/2019-09/schema", "format": "idn-hostname" diff --git a/tests/draft2020-12/optional/format/idn-hostname.json b/tests/draft2020-12/optional/format/idn-hostname.json index eafa4d9d..856b6a7d 100644 --- a/tests/draft2020-12/optional/format/idn-hostname.json +++ b/tests/draft2020-12/optional/format/idn-hostname.json @@ -1,6 +1,9 @@ [ { "description": "validation of internationalized host names", + "specification": [ + {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} + ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "format": "idn-hostname" diff --git a/tests/draft7/optional/format/idn-hostname.json b/tests/draft7/optional/format/idn-hostname.json index 1db070ec..2e10bb2e 100644 --- a/tests/draft7/optional/format/idn-hostname.json +++ b/tests/draft7/optional/format/idn-hostname.json @@ -1,6 +1,9 @@ [ { "description": "validation of internationalized host names", + "specification": [ + {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} + ], "schema": { "format": "idn-hostname" }, "tests": [ { From 4fa572d80d0bf4c2a2dc7b9c83523925be2b84dd Mon Sep 17 00:00:00 2001 From: Oleg Date: Fri, 7 Feb 2025 15:22:26 +0400 Subject: [PATCH 3/3] Move tests for rfc3490#3.1 into a separate test case --- .../optional/format/idn-hostname.json | 34 +++++++++++++------ .../optional/format/idn-hostname.json | 34 +++++++++++++------ .../optional/format/idn-hostname.json | 34 +++++++++++++------ .../draft7/optional/format/idn-hostname.json | 31 +++++++++++------ 4 files changed, 93 insertions(+), 40 deletions(-) diff --git a/tests/draft-next/optional/format/idn-hostname.json b/tests/draft-next/optional/format/idn-hostname.json index 7b48437b..1061f424 100644 --- a/tests/draft-next/optional/format/idn-hostname.json +++ b/tests/draft-next/optional/format/idn-hostname.json @@ -1,9 +1,6 @@ [ { "description": "validation of internationalized host names", - "specification": [ - {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} - ], "schema": { "$schema": "https://json-schema.org/draft/next/schema", "format": "idn-hostname" @@ -334,39 +331,56 @@ "description": "empty string", "data": "", "valid": false - }, + } + ] + }, + { + "description": "validation of separators in internationalized host names", + "specification": [ + {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} + ], + "schema": { + "$schema": "https://json-schema.org/draft/next/schema", + "format": "idn-hostname" + }, + "tests": [ { "description": "single dot", "data": ".", "valid": false }, { - "description": "single ideographic full stop (RFC 3490#3.1)", + "description": "single ideographic full stop", "data": "\u3002", "valid": false }, { - "description": "single fullwidth full stop (RFC 3490#3.1)", + "description": "single fullwidth full stop", "data": "\uff0e", "valid": false }, { - "description": "single halfwidth ideographic full stop (RFC 3490#3.1)", + "description": "single halfwidth ideographic full stop", "data": "\uff61", "valid": false }, { - "description": "ideographic full stop (RFC 3490#3.1) as label separator", + "description": "dot as label separator", + "data": "a.b", + "valid": true + }, + { + "description": "ideographic full stop as label separator", "data": "a\u3002b", "valid": true }, { - "description": "fullwidth full stop (RFC 3490#3.1) as label separator", + "description": "fullwidth full stop as label separator", "data": "a\uff0eb", "valid": true }, { - "description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator", + "description": "halfwidth ideographic full stop as label separator", "data": "a\uff61b", "valid": true } diff --git a/tests/draft2019-09/optional/format/idn-hostname.json b/tests/draft2019-09/optional/format/idn-hostname.json index 2e88e7f9..348c504c 100644 --- a/tests/draft2019-09/optional/format/idn-hostname.json +++ b/tests/draft2019-09/optional/format/idn-hostname.json @@ -1,9 +1,6 @@ [ { "description": "validation of internationalized host names", - "specification": [ - {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} - ], "schema": { "$schema": "https://json-schema.org/draft/2019-09/schema", "format": "idn-hostname" @@ -334,39 +331,56 @@ "description": "empty string", "data": "", "valid": false - }, + } + ] + }, + { + "description": "validation of separators in internationalized host names", + "specification": [ + {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} + ], + "schema": { + "$schema": "https://json-schema.org/draft/2019-09/schema", + "format": "idn-hostname" + }, + "tests": [ { "description": "single dot", "data": ".", "valid": false }, { - "description": "single ideographic full stop (RFC 3490#3.1)", + "description": "single ideographic full stop", "data": "\u3002", "valid": false }, { - "description": "single fullwidth full stop (RFC 3490#3.1)", + "description": "single fullwidth full stop", "data": "\uff0e", "valid": false }, { - "description": "single halfwidth ideographic full stop (RFC 3490#3.1)", + "description": "single halfwidth ideographic full stop", "data": "\uff61", "valid": false }, { - "description": "ideographic full stop (RFC 3490#3.1) as label separator", + "description": "dot as label separator", + "data": "a.b", + "valid": true + }, + { + "description": "ideographic full stop as label separator", "data": "a\u3002b", "valid": true }, { - "description": "fullwidth full stop (RFC 3490#3.1) as label separator", + "description": "fullwidth full stop as label separator", "data": "a\uff0eb", "valid": true }, { - "description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator", + "description": "halfwidth ideographic full stop as label separator", "data": "a\uff61b", "valid": true } diff --git a/tests/draft2020-12/optional/format/idn-hostname.json b/tests/draft2020-12/optional/format/idn-hostname.json index 856b6a7d..f42ae969 100644 --- a/tests/draft2020-12/optional/format/idn-hostname.json +++ b/tests/draft2020-12/optional/format/idn-hostname.json @@ -1,9 +1,6 @@ [ { "description": "validation of internationalized host names", - "specification": [ - {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} - ], "schema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "format": "idn-hostname" @@ -334,39 +331,56 @@ "description": "empty string", "data": "", "valid": false - }, + } + ] + }, + { + "description": "validation of separators in internationalized host names", + "specification": [ + {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} + ], + "schema": { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "format": "idn-hostname" + }, + "tests": [ { "description": "single dot", "data": ".", "valid": false }, { - "description": "single ideographic full stop (RFC 3490#3.1)", + "description": "single ideographic full stop", "data": "\u3002", "valid": false }, { - "description": "single fullwidth full stop (RFC 3490#3.1)", + "description": "single fullwidth full stop", "data": "\uff0e", "valid": false }, { - "description": "single halfwidth ideographic full stop (RFC 3490#3.1)", + "description": "single halfwidth ideographic full stop", "data": "\uff61", "valid": false }, { - "description": "ideographic full stop (RFC 3490#3.1) as label separator", + "description": "dot as label separator", + "data": "a.b", + "valid": true + }, + { + "description": "ideographic full stop as label separator", "data": "a\u3002b", "valid": true }, { - "description": "fullwidth full stop (RFC 3490#3.1) as label separator", + "description": "fullwidth full stop as label separator", "data": "a\uff0eb", "valid": true }, { - "description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator", + "description": "halfwidth ideographic full stop as label separator", "data": "a\uff61b", "valid": true } diff --git a/tests/draft7/optional/format/idn-hostname.json b/tests/draft7/optional/format/idn-hostname.json index 2e10bb2e..5c8cdc77 100644 --- a/tests/draft7/optional/format/idn-hostname.json +++ b/tests/draft7/optional/format/idn-hostname.json @@ -1,9 +1,6 @@ [ { "description": "validation of internationalized host names", - "specification": [ - {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} - ], "schema": { "format": "idn-hostname" }, "tests": [ { @@ -326,39 +323,53 @@ "description": "empty string", "data": "", "valid": false - }, + } + ] + }, + { + "description": "validation of separators in internationalized host names", + "specification": [ + {"rfc3490": "3.1", "quote": "Whenever dots are used as label separators, the following characters MUST be recognized as dots: U+002E (full stop), U+3002 (ideographic full stop), U+FF0E (fullwidth full stop), U+FF61(halfwidth ideographic full stop)"} + ], + "schema": { "format": "idn-hostname" }, + "tests": [ { "description": "single dot", "data": ".", "valid": false }, { - "description": "single ideographic full stop (RFC 3490#3.1)", + "description": "single ideographic full stop", "data": "\u3002", "valid": false }, { - "description": "single fullwidth full stop (RFC 3490#3.1)", + "description": "single fullwidth full stop", "data": "\uff0e", "valid": false }, { - "description": "single halfwidth ideographic full stop (RFC 3490#3.1)", + "description": "single halfwidth ideographic full stop", "data": "\uff61", "valid": false }, { - "description": "ideographic full stop (RFC 3490#3.1) as label separator", + "description": "dot as label separator", + "data": "a.b", + "valid": true + }, + { + "description": "ideographic full stop as label separator", "data": "a\u3002b", "valid": true }, { - "description": "fullwidth full stop (RFC 3490#3.1) as label separator", + "description": "fullwidth full stop as label separator", "data": "a\uff0eb", "valid": true }, { - "description": "halfwidth ideographic full stop (RFC 3490#3.1) as label separator", + "description": "halfwidth ideographic full stop as label separator", "data": "a\uff61b", "valid": true }