mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 22:04:59 +00:00
Initial commit: Added new files to the git repo: test_utils.py
This commit is contained in:
parent
106b72ad70
commit
350ba4574f
1 changed files with 15 additions and 0 deletions
15
test_utils.py
Normal file
15
test_utils.py
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
import unittest
|
||||||
|
from utils import replace_most_similar_chunk
|
||||||
|
|
||||||
|
class TestUtils(unittest.TestCase):
|
||||||
|
def test_replace_most_similar_chunk(self):
|
||||||
|
whole = "This is a sample text.\nAnother line of text.\nYet another line."
|
||||||
|
part = "sample text"
|
||||||
|
replace = "replaced text"
|
||||||
|
expected_output = "This is a replaced text.\nAnother line of text.\nYet another line."
|
||||||
|
|
||||||
|
result = replace_most_similar_chunk(whole, part, replace)
|
||||||
|
self.assertEqual(result, expected_output)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue