Skip to content

Commit dcd0c8e

Browse files
committed
super_errors_multi: lowercase .cmi basenames in snapshot post-processing
`find_in_path_uncap` resolves `.cmi` lookups case-insensitively, so the filename printed in error messages picks up whichever case the host filesystem returns: lowercase on macOS APFS/HFS+, capitalised on Linux ext4. Snapshots captured locally on macOS therefore mismatch on Linux CI (`foo.cmi` vs `Foo.cmi`). Normalise every `.cmi` basename to lowercase in postProcessErrorOutput so snapshots are platform-independent. The same function runs on the expected file too, so existing snapshots keep matching.
1 parent 492fbcc commit dcd0c8e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • tests/build_tests/super_errors_multi

tests/build_tests/super_errors_multi/input.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ function postProcessErrorOutput(fixtureName, output) {
4747
(_match, file) =>
4848
`/.../fixtures/${fixtureName}/${file.replace(/\\/g, "/")}`,
4949
);
50+
// `find_in_path_uncap` resolves `.cmi` lookups case-insensitively, so the
51+
// path printed in error messages picks up whichever case the host
52+
// filesystem returns (lowercase on macOS APFS/HFS+, capitalised on Linux
53+
// ext4). Normalise every `.cmi` basename to lowercase so snapshots are
54+
// platform-independent.
55+
result = result.replace(
56+
/([^/\s]+)\.cmi\b/g,
57+
(_, stem) => `${stem.toLowerCase()}.cmi`,
58+
);
5059
return normalizeNewlines(result);
5160
}
5261

0 commit comments

Comments
 (0)