Skip to content

test: preserve invalid cwd encoding#65

Merged
hyfdev merged 1 commit into
mainfrom
agent/test-invalid-cwd-relative
Jul 15, 2026
Merged

test: preserve invalid cwd encoding#65
hyfdev merged 1 commit into
mainfrom
agent/test-invalid-cwd-relative

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • cover native-invalid Unix bytes inside an explicit cwd used by relative_with
  • verify both borrowed and owned cwd arguments preserve the exact bytes and return owned results
  • record the new encoding/context interaction in the semantic test strategy

Why

Existing invalid-encoding tests covered target and base paths, but not cwd components consumed while resolving relative inputs. A controlled mutation that silently dropped every non-UTF-8 cwd component passed the complete default and cached_current_dir suites. It changed the correct raw result ../invalid-\x80/target into ../anchor/target.

The new test reaches that shared resolution stack through the public API and catches the mutation with an exact byte assertion.

Validation

  • targeted test with default and cached_current_dir configurations
  • complete default suite and doctests
  • controlled mutation fails only after this contract is added
  • cargo fmt --all --check and git diff --check
  • adversarial review independently derived the path result and reproduced the mutation failure

@hyfdev hyfdev force-pushed the agent/test-invalid-cwd-relative branch 2 times, most recently from 828915d to 73b3054 Compare July 15, 2026 09:06
@hyfdev hyfdev force-pushed the agent/test-invalid-cwd-relative branch from 73b3054 to 6771854 Compare July 15, 2026 09:16
@hyfdev hyfdev marked this pull request as ready for review July 15, 2026 09:22
Copilot AI review requested due to automatic review settings July 15, 2026 09:22
@hyfdev hyfdev merged commit 47a4233 into main Jul 15, 2026
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot mentioned this pull request Jul 15, 2026
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