test(hostname): move XN-- positions-3-4 test to A-label group#892
Open
vtushar06 wants to merge 1 commit intojson-schema-org:mainfrom
Open
test(hostname): move XN-- positions-3-4 test to A-label group#892vtushar06 wants to merge 1 commit intojson-schema-org:mainfrom
vtushar06 wants to merge 1 commit intojson-schema-org:mainfrom
Conversation
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.
There was a problem hiding this comment.
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.
Author
|
Hi @karenetheridge, can you please have a look into implementation, and let me know call from your side. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Problem:
Test 20 in Group 1 ("validation of host names") marks
XN--aa---o47jg78qasvalid: falseciting 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--wgbh1cin Group 1 asvalid: 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---o47jg78qfrom 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.