Skip to content

test(hostname): move XN-- positions-3-4 test to A-label group#892

Open
vtushar06 wants to merge 1 commit intojson-schema-org:mainfrom
vtushar06:fix-hostname-xn-test-group
Open

test(hostname): move XN-- positions-3-4 test to A-label group#892
vtushar06 wants to merge 1 commit intojson-schema-org:mainfrom
vtushar06:fix-hostname-xn-test-group

Conversation

@vtushar06
Copy link
Copy Markdown

Description:

Problem:
Test 20 in Group 1 ("validation of host names") marks XN--aa---o47jg78q as valid: false citing RFC 5891 §4.2.3.1 and RFC 5890 §2.3.2.1. These are IDNA2008 RFCs. Group 1 is scoped to RFC 1123 §2.1 which has no positions-3-4 rule.

Evidence of inconsistency:
draft4 accepts xn--4gbwdl.xn--wgbh1c in Group 1 as valid: true - same structural pattern (xn-- prefix with -- at positions 3-4). draft4 has no Group 2 so no IDNA2008 tests exist there at all.

Fix:
Move XN--aa---o47jg78q from Group 1 to Group 2 ("validation of A-label (punycode) host names") in draft7, draft2019-09, draft2020-12, and v1. Group 2 already contains all other RFC 5891/5892 tests - this test belongs there.

draft4 and draft6 have no Group 2 so no changes needed for those drafts.

Result:
Group 1 becomes purely RFC 1123 §2.1 scope across all drafts. Group 2 contains all IDNA2008 tests including this one.

Test json-schema-org#20 in Group 1 marks XN--aa---o47jg78q as invalid citing
RFC 5891 §4.2.3.1 and RFC 5890 §2.3.2.1 (IDNA2008). Group 1 is
scoped to RFC 1123 §2.1 which has no positions-3-4 rule. Group 2
is explicitly 'validation of A-label (punycode) host names' and
contains all other RFC 5891/5892 tests.

This test belongs in Group 2. Moving it there for draft7,
draft2019-09, draft2020-12, and v1. draft4 and draft6 have no
Group 2 so no changes needed there.

Note: draft4 accepts xn--4gbwdl.xn--wgbh1c in Group 1 with no
complaint — same structural pattern as XN--aa---o47jg78q. This
confirms the positions-3-4 rule is IDNA2008 scope not RFC 1123.
Copilot AI review requested due to automatic review settings April 13, 2026 03:57
@vtushar06 vtushar06 requested a review from a team as a code owner April 13, 2026 03:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR re-scopes the hostname format test groups so that “validation of host names” remains strictly within RFC 1123 §2.1 constraints, and the IDNA2008-specific “positions 3-4 is --” case is tested only under the A-label (punycode) group where it belongs.

Changes:

  • Removed XN--aa---o47jg78q (positions-3-4 --) from the RFC 1123 hostname group.
  • Added the same test case to the “validation of A-label (punycode) host names” group.
  • Applied the regrouping consistently across draft7, draft2019-09, draft2020-12, and v1 test suites.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/v1/format/hostname.json Moves the IDNA2008 -- positions-3-4 case from the general hostname group into the A-label group.
tests/draft7/optional/format/hostname.json Same regrouping for draft7 optional hostname format tests.
tests/draft2019-09/optional/format/hostname.json Same regrouping for draft 2019-09 optional hostname format tests.
tests/draft2020-12/optional/format/hostname.json Same regrouping for draft 2020-12 optional hostname format tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vtushar06
Copy link
Copy Markdown
Author

Hi @karenetheridge, can you please have a look into implementation, and let me know call from your side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants