aider is AI pair programming in your terminal https://aider.chat/
Find a file
Paul Gauthier 17589d5241 Add test case for replace_most_similar_chunk with multi-line non-perfect match.
# Context:
USER: add another test case for replace_most_similar_chunk where it's not a perfect match, and part has more than 1 line
ASSISTANT: I will add a new test case to `test_utils.py` where the `part` has more than 1 line and it's not a perfect match.

```python
test_utils.py
<<<<<<< ORIGINAL
if __name__ == "__main__":
    unittest.main()
=======
    def test_replace_most_similar_chunk_not_perfect_match(self):
        whole = "This is a sample text.\nAnother line of text.\nYet another line."
        part = "sample text.\nAnother line"
        replace = "replaced text.\nModified line"
        expected_output = "This is a replaced text.\nModified line of text.\nYet another line."

        result = replace_most_similar_chunk(whole, part, replace)
        self.assertEqual(result, expected_output)

if __name__ == "__main__":
    unittest.main()
>>>>>>> UPDATED
```

This new test case checks if the `replace_most_similar_chunk` function can handle a non-perfect match with a multi-line `part`.
2023-05-09 07:36:07 -07:00
.flake8 debug 2023-05-08 22:55:55 -07:00
.pre-commit-config.yaml added flake8 2023-05-07 22:13:57 -07:00
coder.py WIP: Refactor do_replace method to utils module and update references in coder module. 2023-05-09 07:31:26 -07:00
dump.py init 2023-04-19 09:03:23 -07:00
main.py WIP: Refactor CLI help messages to use $ prefix for environment variables. 2023-05-09 00:38:10 -07:00
prompts.py prompts 2023-05-09 00:38:55 -07:00
test_utils.py Add test case for replace_most_similar_chunk with multi-line non-perfect match. 2023-05-09 07:36:07 -07:00
utils.py WIP: Remove print statement in do_replace function. 2023-05-09 07:33:58 -07:00