mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 08:14:59 +00:00
Merge branch 'main' into edit-formats
This commit is contained in:
commit
fc6dd1877c
2 changed files with 15 additions and 1 deletions
|
@ -209,6 +209,20 @@ These changes replace the `subprocess.run` patches with `subprocess.check_output
|
|||
result = eb.replace_part_with_missing_leading_whitespace(whole, part, replace)
|
||||
self.assertEqual(result, expected_output)
|
||||
|
||||
def test_replace_part_with_missing_leading_whitespace_including_blank_lines(self):
|
||||
"""
|
||||
The part has leading whitespace on all lines, so should be ignored.
|
||||
But it has a *blank* line with no whitespace at all, which was causing a
|
||||
bug per issue #25. Test case to repro and confirm fix.
|
||||
"""
|
||||
whole = " line1\n line2\n line3\n"
|
||||
part = "\n line1\n line2"
|
||||
replace = "new_line1\nnew_line2"
|
||||
expected_output = None
|
||||
|
||||
result = utils.replace_part_with_missing_leading_whitespace(whole, part, replace)
|
||||
self.assertEqual(result, expected_output)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue