Skip to content

test: expect forward-slash paths in parallel_test on Windows - #265

Open
theprinceraj wants to merge 1 commit into
prooflinedev:mainfrom
theprinceraj:fix/windows-path-separator-tests
Open

theprinceraj wants to merge 1 commit into
prooflinedev:mainfrom
theprinceraj:fix/windows-path-separator-tests

Conversation

@theprinceraj

Copy link
Copy Markdown

Fixes #264

yek intentionally outputs /-separated paths on every platform (normalize_path in src/parallel.rs uses to_slash()). Four tests in tests/parallel_test.rs built their expected values with to_string_lossy(), which uses \ on Windows, so they always failed there.

Changes

  • Glob tests (test_glob_pattern_single_file, _multiple_files, _nested_directories): build expected paths with path_slash's to_slash_lossy(), the same crate yek uses.
  • test_normalize_path_unix_style: it never called yek's code; it tested the normalize-path crate plus to_string_lossy(). It now calls yek::parallel::normalize_path.

Only test expectations change, not yek's behavior. On Linux/macOS to_slash_lossy() returns the same string as to_string_lossy(), so results there are unchanged.

Testing (Windows 11)

  • cargo test --test parallel_test: 21 passed (was 17 passed, 4 failed)
  • cargo fmt --check and cargo clippy --test parallel_test are clean

@theprinceraj

Copy link
Copy Markdown
Author

Coverage failure is unrelated, the job dies on git checkout ${{ github.head_ref }}:

error: pathspec 'fix/windows-path-separator-tests' did not match any file(s) known to git

Branch only exists on my fork, so this'll happen on any fork PR. Checking out github.event.pull_request.head.sha instead should fix it, happy to send a PR.

This branch has not been deployed

No deployments
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.

parallel_test fails on Windows: path separator mismatch

1 participant