Skip to content

test(core): Unicode identifier and path edge-case coverage (#45)#145

Merged
Connorrmcd6 merged 1 commit into
mainfrom
test/unicode-path-coverage-45
Jun 29, 2026
Merged

test(core): Unicode identifier and path edge-case coverage (#45)#145
Connorrmcd6 merged 1 commit into
mainfrom
test/unicode-path-coverage-45

Conversation

@Connorrmcd6

Copy link
Copy Markdown
Owner

Summary

All surf-core fixtures were ASCII, leaving two coverage gaps from #45. This PR closes both — pure test coverage, no behaviour or hash-format change.

What changed and why

Unicode identifiers (café/δ across Rust, TypeScript, Python, Go):

  • golden_hash.rsgolden_unicode_identifier_hashes_are_stable() pins exact V1/V2 digests per family, so any future locale/encoding sensitivity in canonicalization shows up as a loud golden diff. unicode_identifier_hashes_are_recomputation_stable() covers the determinism half.
  • resolve.rsunicode_identifier_resolves_across_families() proves each anchor resolves to the Unicode-named body.

Path edge cases (anchor.rs tests): the grammar (§6.3) mandates forward slashes. Two tests pin the current behaviour (backslash / mixed-separator paths parse Ok verbatim); two #[ignore]'d xfail tests document the target — a clear parse error.

Bug surfaced (not fixed here)

parse_anchor("auth\\service.ts > Foo") returns Ok with the backslash retained in Anchor::file, so a Windows-style path silently fails to match on disk instead of erroring. Per the issue's guidance this is tracked as a follow-up (#144) rather than fixed inline, keeping this PR reviewable as coverage-only. The xfail tests flip to assertions when #144 lands.

Verification

All gates run locally on this branch:

Closes #45

🤖 Generated with Claude Code

All fixtures were ASCII, leaving two gaps. Add non-ASCII symbol coverage
across the four language families: golden hashes pinned per recipe so any
future locale/encoding sensitivity in canonicalization becomes a loud diff,
plus matching resolution cases proving anchors land on the Unicode body.

For path edge cases, pin the current behaviour (backslash / mixed-separator
paths parse Ok verbatim) and add #[ignore]'d xfail tests documenting the
target — a clear parse error. The silent non-match this exposes is tracked
in #144 rather than fixed inline, keeping this PR to coverage only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Connorrmcd6 Connorrmcd6 merged commit b0d104d into main Jun 29, 2026
4 checks passed
@Connorrmcd6 Connorrmcd6 deleted the test/unicode-path-coverage-45 branch June 29, 2026 08:40
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.

core: test coverage for Unicode identifiers and path edge cases

1 participant