From d24ab44424c2f57cabfee5d6d5f238fef5121ee2 Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Thu, 11 Jun 2026 23:36:07 +0530 Subject: [PATCH 1/3] test(idn-hostname): add Bidi rule (RFC 5893) cases --- .../optional/format/idn-hostname.json | 24 +++++++++++++++++++ .../optional/format/idn-hostname.json | 24 +++++++++++++++++++ .../draft7/optional/format/idn-hostname.json | 24 +++++++++++++++++++ tests/v1/format/idn-hostname.json | 24 +++++++++++++++++++ 4 files changed, 96 insertions(+) diff --git a/tests/draft2019-09/optional/format/idn-hostname.json b/tests/draft2019-09/optional/format/idn-hostname.json index 45ccf3338..07976f0b9 100644 --- a/tests/draft2019-09/optional/format/idn-hostname.json +++ b/tests/draft2019-09/optional/format/idn-hostname.json @@ -331,6 +331,30 @@ "description": "empty string", "data": "", "valid": false + }, + { + "description": "Bidi domain name with a digit-first label is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", + "data": "0a.\u05d0", + "valid": false + }, + { + "description": "label starting with a digit before a right-to-left letter is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "0\u0627", + "valid": false + }, + { + "description": "left-to-right label containing a right-to-left letter is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "a\u05d0", + "valid": false + }, + { + "description": "right-to-left label mixing European and Arabic-Indic digits is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "\u05d00\u0660", + "valid": false } ] }, diff --git a/tests/draft2020-12/optional/format/idn-hostname.json b/tests/draft2020-12/optional/format/idn-hostname.json index 3bb59820b..7dfd9ccb2 100644 --- a/tests/draft2020-12/optional/format/idn-hostname.json +++ b/tests/draft2020-12/optional/format/idn-hostname.json @@ -331,6 +331,30 @@ "description": "empty string", "data": "", "valid": false + }, + { + "description": "Bidi domain name with a digit-first label is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", + "data": "0a.\u05d0", + "valid": false + }, + { + "description": "label starting with a digit before a right-to-left letter is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "0\u0627", + "valid": false + }, + { + "description": "left-to-right label containing a right-to-left letter is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "a\u05d0", + "valid": false + }, + { + "description": "right-to-left label mixing European and Arabic-Indic digits is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "\u05d00\u0660", + "valid": false } ] }, diff --git a/tests/draft7/optional/format/idn-hostname.json b/tests/draft7/optional/format/idn-hostname.json index 53faa3967..1cdb2f103 100644 --- a/tests/draft7/optional/format/idn-hostname.json +++ b/tests/draft7/optional/format/idn-hostname.json @@ -323,6 +323,30 @@ "description": "empty string", "data": "", "valid": false + }, + { + "description": "Bidi domain name with a digit-first label is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", + "data": "0a.\u05d0", + "valid": false + }, + { + "description": "label starting with a digit before a right-to-left letter is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "0\u0627", + "valid": false + }, + { + "description": "left-to-right label containing a right-to-left letter is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "a\u05d0", + "valid": false + }, + { + "description": "right-to-left label mixing European and Arabic-Indic digits is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "\u05d00\u0660", + "valid": false } ] }, diff --git a/tests/v1/format/idn-hostname.json b/tests/v1/format/idn-hostname.json index 08e9191b8..73df9e77d 100644 --- a/tests/v1/format/idn-hostname.json +++ b/tests/v1/format/idn-hostname.json @@ -331,6 +331,30 @@ "description": "empty string", "data": "", "valid": false + }, + { + "description": "Bidi domain name with a digit-first label is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", + "data": "0a.\u05d0", + "valid": false + }, + { + "description": "label starting with a digit before a right-to-left letter is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "0\u0627", + "valid": false + }, + { + "description": "left-to-right label containing a right-to-left letter is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "a\u05d0", + "valid": false + }, + { + "description": "right-to-left label mixing European and Arabic-Indic digits is invalid", + "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "data": "\u05d00\u0660", + "valid": false } ] }, From 55eca279eb9ac83ef76d7e75a565c26b188313ec Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Thu, 11 Jun 2026 23:57:45 +0530 Subject: [PATCH 2/3] test(idn-hostname): shorten test description under 70 chars --- tests/draft2019-09/optional/format/idn-hostname.json | 2 +- tests/draft2020-12/optional/format/idn-hostname.json | 2 +- tests/draft7/optional/format/idn-hostname.json | 2 +- tests/v1/format/idn-hostname.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/draft2019-09/optional/format/idn-hostname.json b/tests/draft2019-09/optional/format/idn-hostname.json index 07976f0b9..11e75e8ad 100644 --- a/tests/draft2019-09/optional/format/idn-hostname.json +++ b/tests/draft2019-09/optional/format/idn-hostname.json @@ -351,7 +351,7 @@ "valid": false }, { - "description": "right-to-left label mixing European and Arabic-Indic digits is invalid", + "description": "right-to-left label mixing both digit types is invalid", "comment": "https://tools.ietf.org/html/rfc5893#section-2", "data": "\u05d00\u0660", "valid": false diff --git a/tests/draft2020-12/optional/format/idn-hostname.json b/tests/draft2020-12/optional/format/idn-hostname.json index 7dfd9ccb2..d938a82be 100644 --- a/tests/draft2020-12/optional/format/idn-hostname.json +++ b/tests/draft2020-12/optional/format/idn-hostname.json @@ -351,7 +351,7 @@ "valid": false }, { - "description": "right-to-left label mixing European and Arabic-Indic digits is invalid", + "description": "right-to-left label mixing both digit types is invalid", "comment": "https://tools.ietf.org/html/rfc5893#section-2", "data": "\u05d00\u0660", "valid": false diff --git a/tests/draft7/optional/format/idn-hostname.json b/tests/draft7/optional/format/idn-hostname.json index 1cdb2f103..9fec60b4a 100644 --- a/tests/draft7/optional/format/idn-hostname.json +++ b/tests/draft7/optional/format/idn-hostname.json @@ -343,7 +343,7 @@ "valid": false }, { - "description": "right-to-left label mixing European and Arabic-Indic digits is invalid", + "description": "right-to-left label mixing both digit types is invalid", "comment": "https://tools.ietf.org/html/rfc5893#section-2", "data": "\u05d00\u0660", "valid": false diff --git a/tests/v1/format/idn-hostname.json b/tests/v1/format/idn-hostname.json index 73df9e77d..c4ba9c11e 100644 --- a/tests/v1/format/idn-hostname.json +++ b/tests/v1/format/idn-hostname.json @@ -351,7 +351,7 @@ "valid": false }, { - "description": "right-to-left label mixing European and Arabic-Indic digits is invalid", + "description": "right-to-left label mixing both digit types is invalid", "comment": "https://tools.ietf.org/html/rfc5893#section-2", "data": "\u05d00\u0660", "valid": false From 4b956e841f5a81dbd3443c635b7f44d94e49bb6e Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Fri, 12 Jun 2026 00:02:27 +0530 Subject: [PATCH 3/3] test(idn-hostname): use rfc-editor.org for RFC links --- tests/draft2019-09/optional/format/idn-hostname.json | 8 ++++---- tests/draft2020-12/optional/format/idn-hostname.json | 8 ++++---- tests/draft7/optional/format/idn-hostname.json | 8 ++++---- tests/v1/format/idn-hostname.json | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/draft2019-09/optional/format/idn-hostname.json b/tests/draft2019-09/optional/format/idn-hostname.json index 11e75e8ad..5581c6f60 100644 --- a/tests/draft2019-09/optional/format/idn-hostname.json +++ b/tests/draft2019-09/optional/format/idn-hostname.json @@ -334,25 +334,25 @@ }, { "description": "Bidi domain name with a digit-first label is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", "data": "0a.\u05d0", "valid": false }, { "description": "label starting with a digit before a right-to-left letter is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "0\u0627", "valid": false }, { "description": "left-to-right label containing a right-to-left letter is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "a\u05d0", "valid": false }, { "description": "right-to-left label mixing both digit types is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "\u05d00\u0660", "valid": false } diff --git a/tests/draft2020-12/optional/format/idn-hostname.json b/tests/draft2020-12/optional/format/idn-hostname.json index d938a82be..7f7f09637 100644 --- a/tests/draft2020-12/optional/format/idn-hostname.json +++ b/tests/draft2020-12/optional/format/idn-hostname.json @@ -334,25 +334,25 @@ }, { "description": "Bidi domain name with a digit-first label is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", "data": "0a.\u05d0", "valid": false }, { "description": "label starting with a digit before a right-to-left letter is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "0\u0627", "valid": false }, { "description": "left-to-right label containing a right-to-left letter is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "a\u05d0", "valid": false }, { "description": "right-to-left label mixing both digit types is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "\u05d00\u0660", "valid": false } diff --git a/tests/draft7/optional/format/idn-hostname.json b/tests/draft7/optional/format/idn-hostname.json index 9fec60b4a..2252ccc7e 100644 --- a/tests/draft7/optional/format/idn-hostname.json +++ b/tests/draft7/optional/format/idn-hostname.json @@ -326,25 +326,25 @@ }, { "description": "Bidi domain name with a digit-first label is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", "data": "0a.\u05d0", "valid": false }, { "description": "label starting with a digit before a right-to-left letter is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "0\u0627", "valid": false }, { "description": "left-to-right label containing a right-to-left letter is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "a\u05d0", "valid": false }, { "description": "right-to-left label mixing both digit types is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "\u05d00\u0660", "valid": false } diff --git a/tests/v1/format/idn-hostname.json b/tests/v1/format/idn-hostname.json index c4ba9c11e..e49b9b497 100644 --- a/tests/v1/format/idn-hostname.json +++ b/tests/v1/format/idn-hostname.json @@ -334,25 +334,25 @@ }, { "description": "Bidi domain name with a digit-first label is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2 a label in a Bidi domain name must start with an L, R or AL character", "data": "0a.\u05d0", "valid": false }, { "description": "label starting with a digit before a right-to-left letter is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "0\u0627", "valid": false }, { "description": "left-to-right label containing a right-to-left letter is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "a\u05d0", "valid": false }, { "description": "right-to-left label mixing both digit types is invalid", - "comment": "https://tools.ietf.org/html/rfc5893#section-2", + "comment": "https://www.rfc-editor.org/rfc/rfc5893#section-2", "data": "\u05d00\u0660", "valid": false }