test(core): Unicode identifier and path edge-case coverage (#45)#145
Merged
Conversation
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>
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.
Summary
All
surf-corefixtures 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.rs—golden_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.rs—unicode_identifier_resolves_across_families()proves each anchor resolves to the Unicode-named body.Path edge cases (
anchor.rstests): the grammar (§6.3) mandates forward slashes. Two tests pin the current behaviour (backslash / mixed-separator paths parseOkverbatim); two#[ignore]'d xfail tests document the target — a clear parse error.Bug surfaced (not fixed here)
parse_anchor("auth\\service.ts > Foo")returnsOkwith the backslash retained inAnchor::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:
cargo fmt --all --check— cleancargo clippy --all-targets --all-features -- -D warnings— cleancargo test --all— all pass (2 ignored: the core: backslash / Windows-style anchor paths silently parse instead of erroring #144 xfails)Closes #45
🤖 Generated with Claude Code