From 347ad340380c9e53f36b6d5f690fc26e5af6e039 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 29 Oct 2024 13:48:16 -0700 Subject: [PATCH] fix: update file path comparison in commands test to handle macOS prefix --- tests/basic/test_commands.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/basic/test_commands.py b/tests/basic/test_commands.py index a1019931b..f5d23e0b3 100644 --- a/tests/basic/test_commands.py +++ b/tests/basic/test_commands.py @@ -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("")