Skip to content

fix(test): fix hash is not stable on Windows#1247

Open
cscnk52 wants to merge 3 commits into
parcel-bundler:masterfrom
cscnk52:fix-windows-hash
Open

fix(test): fix hash is not stable on Windows#1247
cscnk52 wants to merge 3 commits into
parcel-bundler:masterfrom
cscnk52:fix-windows-hash

Conversation

@cscnk52

@cscnk52 cscnk52 commented May 23, 2026

Copy link
Copy Markdown
Contributor

On Windows, the path is separated by "\\", not "/", this PR normalize it to prevent hash not stable.

This test was failed on Windows.

---- tests::test_css_modules stdout ----

thread 'tests::test_css_modules' (27464) panicked at src\lib.rs:27055:7:
assertion failed: `(left == right)`

Diff < left / right > :
- <.Ot1kIW_foo {
+ >.EgL3uq_foo {
   background: red;
 }

Comment thread src/css_modules.rs
)

// normalize path on Windows
let normalized = source.to_string_lossy().replace("\\", "/");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This does not account for UNC

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