mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 00:05:01 +00:00
find_original_update_blocks now accepts fence param, raises on mangled <source>filename.ext #317
This commit is contained in:
parent
f0711d4b96
commit
2609ec1b06
2 changed files with 52 additions and 15 deletions
|
@ -80,6 +80,29 @@ Hope you like it!
|
|||
edits = list(eb.find_original_update_blocks(edit))
|
||||
self.assertEqual(edits, [("foo.txt", "Two\n", "Tooooo\n")])
|
||||
|
||||
def test_find_original_update_blocks_mangled_filename_w_source_tag(self):
|
||||
source = "source"
|
||||
|
||||
edit = """
|
||||
Here's the change:
|
||||
|
||||
<%s>foo.txt
|
||||
<<<<<<< SEARCH
|
||||
One
|
||||
=======
|
||||
Two
|
||||
>>>>>>> REPLACE
|
||||
</%s>
|
||||
|
||||
Hope you like it!
|
||||
""" % (source, source)
|
||||
|
||||
fence = ("<%s>" % source, "</%s>" % source)
|
||||
|
||||
with self.assertRaises(ValueError) as cm:
|
||||
_edits = list(eb.find_original_update_blocks(edit, fence))
|
||||
self.assertIn("missing filename", str(cm.exception))
|
||||
|
||||
def test_find_original_update_blocks_quote_below_filename(self):
|
||||
edit = """
|
||||
Here's the change:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue