Skip to content

Commit a790216

Browse files
committed
Fix symlinked-path glob test on Windows
Normalize path separators on both sides of the assertion so the backslash paths returned by os.path.realpath on Windows match the forward-slash paths git outputs. No-op on Linux/macOS.
1 parent 80ed361 commit a790216

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎tests/test_filesystem.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,9 @@ def test_glob_and_grep_work_through_symlinked_path(self):
569569
out = GlobTool().run({"pattern": "*", "path": link}, self.ctx)
570570
self.assertNotIn("outside repository", out)
571571
self.assertNotIn("Glob failed", out)
572-
self.assertIn(os.path.realpath(os.path.join(real, "a.py")), out)
572+
# Normalize path separators for Windows compatibility
573+
expected = os.path.realpath(os.path.join(real, "a.py")).replace("\\", "/")
574+
self.assertIn(expected, out.replace("\\", "/"))
573575
out = Grep().run({"regex": "hello", "path": link}, self.ctx)
574576
self.assertIn("a.py", out)
575577
self.assertIn("hello", out)

0 commit comments

Comments
 (0)