mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 23:05:00 +00:00
fix: handle macOS /private/ prefix in file path tests
This commit is contained in:
parent
26a85c2047
commit
56f3220d4c
1 changed files with 16 additions and 2 deletions
|
@ -749,7 +749,14 @@ class TestCommands(TestCase):
|
||||||
with open(session_file, encoding=io.encoding) as f:
|
with open(session_file, encoding=io.encoding) as f:
|
||||||
commands_text = f.read()
|
commands_text = f.read()
|
||||||
self.assertIn("/add file1.txt", commands_text)
|
self.assertIn("/add file1.txt", commands_text)
|
||||||
self.assertIn(f"/read-only {external_file_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_file_path):
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
self.fail(f"No matching read-only command found for {external_file_path}")
|
||||||
|
|
||||||
# Clear the current session
|
# Clear the current session
|
||||||
commands.cmd_reset("")
|
commands.cmd_reset("")
|
||||||
|
@ -815,7 +822,14 @@ class TestCommands(TestCase):
|
||||||
with open(session_file, encoding=io.encoding) as f:
|
with open(session_file, encoding=io.encoding) as f:
|
||||||
commands_text = f.read()
|
commands_text = f.read()
|
||||||
self.assertIn("/add internal1.txt", commands_text)
|
self.assertIn("/add internal1.txt", commands_text)
|
||||||
self.assertIn(f"/read-only {external_file1_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_file1_path):
|
||||||
|
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)
|
self.assertIn(f"/read-only {external_file2_path}", commands_text)
|
||||||
|
|
||||||
# Clear the current session
|
# Clear the current session
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue