mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
![]() # Context: USER: add a test for `replace_part_with_missing_leading_whitespace` ASSISTANT: To add a test for `replace_part_with_missing_leading_whitespace`, we will modify the `tests/test_utils.py` file. ```python tests/test_utils.py <<<<<<< ORIGINAL if __name__ == "__main__": unittest.main() ======= def test_replace_part_with_missing_leading_whitespace(self): whole = " line1\n line2\n line3\n" part = "line1\nline2" replace = "new_line1\nnew_line2" expected_output = " new_line1\n new_line2\n line3\n" result = utils.replace_part_with_missing_leading_whitespace(whole, part, replace) self.assertEqual(result, expected_output) if __name__ == "__main__": unittest.main() >>>>>>> UPDATED ``` This new test case checks if the `replace_part_with_missing_leading_whitespace` function correctly handles the case when the part and replace blocks have missing leading whitespaces. |
||
---|---|---|
.. | ||
__init__.py | ||
test_coder.py | ||
test_commands.py | ||
test_io.py | ||
test_main.py | ||
test_repomap.py | ||
test_utils.py |