Skip to content

test: cover the "::" grammar boundaries of the IPv6 host parser - #1242

Merged
anonrig merged 1 commit into
ada-url:mainfrom
ikkyu3:test-ipv6-double-colon-boundaries
Aug 29, 2026
Merged

anonrig merged 1 commit into
ada-url:mainfrom
ikkyu3:test-ipv6-double-colon-boundaries

Conversation

@ikkyu3

@ikkyu3 ikkyu3 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds regression tests for host-parsing boundaries around :: in IPv6
literals — group count, per-group hex width, and lone (non-doubled)
leading/trailing colons — that aren't currently exercised by
tests/wpt/urltestdata.json's existing IPv6 cases.

Motivated by #1233, which rewrote this parser; the new tests pin down the
exact WHATWG grammar boundaries it (and the scalar fallback) must continue
to enforce, independent of which code path handles a given build.

What's covered

  • :: must elide at least one group (all-8-groups-explicit + :: is invalid)
  • a single elided zero-piece is not re-compressed to :: on serialization
    (only runs of ≥ 2 are, per spec)
  • a group holds at most 4 hex digits
  • uppercase hex digits are accepted and normalized to lowercase
  • a lone leading or trailing colon is invalid even when a genuine ::
    appears elsewhere in the same host
  • more than one :: is invalid
  • the full-width, no-compression boundary (8 groups × 4 hex digits, the
    longest valid non-compressed address)

Test plan

  • New tests pass for both ada::url and ada::url_aggregator
  • Full basic_tests suite passes locally (207/207)
  • clang-format clean (LLVM 22, project config)

@lemire

lemire commented Aug 29, 2026

Copy link
Copy Markdown
Member

Running tests.

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.28%. Comparing base (9aa61f0) to head (071fc96).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1242      +/-   ##
==========================================
+ Coverage   63.25%   63.28%   +0.02%     
==========================================
  Files          39       39              
  Lines        7699     7699              
  Branches     3514     3514              
==========================================
+ Hits         4870     4872       +2     
  Misses        749      749              
+ Partials     2080     2078       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@anonrig
anonrig merged commit 43e19e6 into ada-url:main Aug 29, 2026
54 checks passed
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.

3 participants