Handle existing dirnames with [globby] chars, with test #195

This commit is contained in:
Paul Gauthier 2024-04-30 15:50:24 -07:00
parent a3a4d87a0c
commit e610e5bd0a
2 changed files with 23 additions and 4 deletions

View file

@ -386,6 +386,23 @@ class TestCommands(TestCase):
self.assertIn(str(fname.resolve()), coder.abs_fnames)
def test_cmd_add_dirname_with_special_chars(self):
with ChdirTemporaryDirectory():
io = InputOutput(pretty=False, yes=False)
from aider.coders import Coder
coder = Coder.create(self.GPT35, None, io)
commands = Commands(io, coder)
dname = Path("with[brackets]")
dname.mkdir()
fname = dname / "filename.txt"
fname.touch()
commands.cmd_add(str(dname))
self.assertIn(str(fname.resolve()), coder.abs_fnames)
def test_cmd_add_abs_filename(self):
with ChdirTemporaryDirectory():
io = InputOutput(pretty=False, yes=False)