You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add a deterministic Windows-only regression test for embedded-NUL drive-relative paths
require try_absolutize and both target/base roles of try_relative to preserve the native error kind and raw OS error, while the strict APIs panic
require the test to register and execute in both default and cached_current_dir CI configurations, and record the contract in the testing strategy
Why
Windows drive-relative ambient resolution delegates to std::path::absolute. Existing coverage exercised successful invalid-wide resolution and Unix cwd failures, but not an error from this Windows-specific branch. A regression could therefore bypass the native per-drive resolution path or mishandle its error without being detected.
An embedded NUL is deterministic under the pinned Rust 1.97.0 standard library: conversion to the WinAPI input buffer returns InvalidInput before GetFullPathNameW, so the test does not depend on drive mappings, filesystem contents, or runner cwd state.
Impact
This is a test-only contract change. Production code, dependencies, benchmarks, and allocation baselines are unchanged.
Validation
cargo fmt --all --check
default and cached_current_dir workspace test suites
Reviewed PR #71 (head 928118e5) as an adversarial pass over the test-only Windows drive-relative error coverage.
Verdict: approve — no open findings.
Scope checked
.agents/docs/testing-strategy.md
.github/workflows/test.yaml
tests/windows_drive_relative_errors.rs
surrounding production path for Windows drive-relative ambient resolution and try_* / strict API error contracts
Assessment
This fills a real branch gap: ambient drive-relative resolution goes through std::path::absolute, and the new integration test forces that path with an embedded NUL so failure does not depend on drive maps, filesystem state, or cwd. Against the pinned Rust 1.97.0 std, interior NULs are rejected with ErrorKind::InvalidInput before GetFullPathNameW, so the claimed determinism holds. Production try_absolutize / try_relative propagate via ?; strict APIs panic through .expect(...). CI registers the exact test name on the Windows host list for both default and cached_current_dir listing gates, and the testing-strategy note matches the wiring.
No correctness, flakiness, incomplete contract coverage, or documentation mismatches found.
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
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
try_absolutizeand both target/base roles oftry_relativeto preserve the native error kind and raw OS error, while the strict APIs paniccached_current_dirCI configurations, and record the contract in the testing strategyWhy
Windows drive-relative ambient resolution delegates to
std::path::absolute. Existing coverage exercised successful invalid-wide resolution and Unix cwd failures, but not an error from this Windows-specific branch. A regression could therefore bypass the native per-drive resolution path or mishandle its error without being detected.An embedded NUL is deterministic under the pinned Rust 1.97.0 standard library: conversion to the WinAPI input buffer returns
InvalidInputbeforeGetFullPathNameW, so the test does not depend on drive mappings, filesystem contents, or runner cwd state.Impact
This is a test-only contract change. Production code, dependencies, benchmarks, and allocation baselines are unchanged.
Validation
cargo fmt --all --checkcached_current_dirworkspace test suitescargo clippy --locked --workspace --all-targets --all-features -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --locked -p sugar_path --all-features --no-deps