Skip to content

test: preserve non-UTF-8 ambient cwd#68

Merged
hyfdev merged 1 commit into
mainfrom
agent/test-ambient-non-utf8-cwd
Jul 15, 2026
Merged

test: preserve non-UTF-8 ambient cwd#68
hyfdev merged 1 commit into
mainfrom
agent/test-ambient-non-utf8-cwd

Conversation

@hyfdev

@hyfdev hyfdev commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a Linux-only child-process test that starts from a real cwd containing the invalid native byte 0x80
  • require absolutize, try_absolutize, relative, and try_relative to preserve the cwd bytes exactly
  • execute the contract under both default and cached_current_dir configurations through the native CI inventory
  • record the ambient native-encoding coverage in the testing strategy

Why

Existing tests cover non-UTF-8 inputs with an ordinary ambient cwd and non-UTF-8 explicit cwd arguments, but not an ambient cwd whose own filesystem spelling is non-UTF-8.

A controlled mutation rebuilt cwd through to_string_lossy() in both feature branches. The existing complete default and cached suites remained green, even though the mutation changes the native byte 0x80 into the UTF-8 replacement sequence EF BF BD before all four ambient APIs use it.

The new test runs in a fresh integration-test child process so the cached cwd cannot be initialized by the parent. It derives expected paths from std::env::current_dir() and compares raw bytes, without imposing a Cow or allocation requirement on the non-UTF-8 case.

Platform scope

Linux supplies the executable filesystem case because macOS rejects the invalid-byte directory name with EILSEQ. The test is therefore required only in the native Linux inventory; explicit-cwd tests continue to cover native-invalid Unix composition independently of the host filesystem.

Validation

  • complete default suite: pass
  • complete cached_current_dir workspace suite: pass
  • full Clippy with warnings denied: pass
  • documentation and package verification: pass
  • Linux library and integration-test metadata cross-compilation: pass
  • controlled lossy-cwd mutation: previous default 112 and cached 113 tests remained green
  • native Linux child-process test: pass under default and cached_current_dir
  • native Linux required-test registration: pass
  • all seven hosted checks: pass
  • independent adversarial review: pass

@hyfdev
hyfdev marked this pull request as ready for review July 15, 2026 14:35
Copilot AI review requested due to automatic review settings July 15, 2026 14:35

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.

@hyfdev
hyfdev merged commit 6d809ec into main Jul 15, 2026
7 checks passed
@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