mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
Added test case and fix for /drop too
This commit is contained in:
parent
d785d9a2e2
commit
450a5fff19
2 changed files with 7 additions and 1 deletions
|
@ -328,7 +328,7 @@ class Commands:
|
||||||
self.io.tool_error(f"No files matched '{word}'")
|
self.io.tool_error(f"No files matched '{word}'")
|
||||||
|
|
||||||
for matched_file in matched_files:
|
for matched_file in matched_files:
|
||||||
abs_fname = str(Path(matched_file).resolve())
|
abs_fname = self.coder.abs_root_path(matched_file)
|
||||||
if abs_fname in self.coder.abs_fnames:
|
if abs_fname in self.coder.abs_fnames:
|
||||||
self.coder.abs_fnames.remove(abs_fname)
|
self.coder.abs_fnames.remove(abs_fname)
|
||||||
self.io.tool_output(f"Removed {matched_file} from the chat")
|
self.io.tool_output(f"Removed {matched_file} from the chat")
|
||||||
|
|
|
@ -127,6 +127,12 @@ class TestCommands(TestCase):
|
||||||
# it should be there, but was not in v0.10.0
|
# it should be there, but was not in v0.10.0
|
||||||
self.assertIn(abs_fname, coder.abs_fnames)
|
self.assertIn(abs_fname, coder.abs_fnames)
|
||||||
|
|
||||||
|
# drop it via it's git_root referenced name
|
||||||
|
commands.cmd_drop("test_dir/another_dir/test_file.txt")
|
||||||
|
|
||||||
|
# it should be there, but was not in v0.10.0
|
||||||
|
self.assertNotIn(abs_fname, coder.abs_fnames)
|
||||||
|
|
||||||
def test_cmd_drop_with_glob_patterns(self):
|
def test_cmd_drop_with_glob_patterns(self):
|
||||||
# Initialize the Commands and InputOutput objects
|
# Initialize the Commands and InputOutput objects
|
||||||
io = InputOutput(pretty=False, yes=True)
|
io = InputOutput(pretty=False, yes=True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue