Skip to content

Commit 8c825be

Browse files
committed
Normalize path separators in assert_equal for Windows compatibility
Windows uses backslashes in paths while the expected test outputs use forward slashes. Normalize both to forward slashes for comparison.
1 parent 7301cd8 commit 8c825be

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/test_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
def assert_equal(expected: bytes, actual: bytes):
2020
"""Stand in for Python's assert which is annoying to work with."""
2121
actual = actual.replace(b"\r", b"") # ignore windows file ending differences
22+
# Normalize path separators for cross-platform compatibility
23+
actual = actual.replace(b"\\", b"/")
24+
expected = expected.replace(b"\\", b"/")
2225
# Normalize trailing newlines to handle platform differences (especially cppcheck on Windows)
2326
if actual and actual.strip() and expected and expected.strip():
2427
if b"\n" in actual or b"\n" in expected:

0 commit comments

Comments
 (0)