fix: update file path comparison in commands test to handle macOS prefix

This commit is contained in:
Paul Gauthier (aider) 2024-10-29 13:48:16 -07:00
parent ccdd333ba3
commit 347ad34038

View file

@ -830,7 +830,14 @@ class TestCommands(TestCase):
break
else:
self.fail(f"No matching read-only command found for {external_file1_path}")
self.assertIn(f"/read-only {external_file2_path}", commands_text)
# Split commands and check each one
for line in commands_text.splitlines():
if line.startswith("/read-only "):
saved_path = line.split(" ", 1)[1]
if os.path.samefile(saved_path, external_file2_path):
break
else:
self.fail(f"No matching read-only command found for {external_file2_path}")
# Clear the current session
commands.cmd_reset("")