mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
added test_replace_part_with_missing_varied_leading_whitespace
This commit is contained in:
parent
6ac2c45735
commit
60e49ae40c
1 changed files with 20 additions and 0 deletions
|
@ -215,6 +215,26 @@ These changes replace the `subprocess.run` patches with `subprocess.check_output
|
|||
self.assertEqual(edit_blocks[0][0], "tests/test_repomap.py")
|
||||
self.assertEqual(edit_blocks[1][0], "tests/test_repomap.py")
|
||||
|
||||
def test_replace_part_with_missing_varied_leading_whitespace(self):
|
||||
whole = """
|
||||
line1
|
||||
line2
|
||||
line3
|
||||
line4
|
||||
"""
|
||||
|
||||
part = "line2\n line3\n"
|
||||
replace = "new_line2\n new_line3\n"
|
||||
expected_output = """
|
||||
line1
|
||||
new_line2
|
||||
new_line3
|
||||
line4
|
||||
"""
|
||||
|
||||
result = eb.replace_part_with_missing_leading_whitespace(whole, part, replace)
|
||||
self.assertEqual(result, expected_output)
|
||||
|
||||
def test_replace_part_with_missing_leading_whitespace(self):
|
||||
whole = " line1\n line2\n line3\n"
|
||||
part = "line1\nline2"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue