Skip to content

Commit

Permalink
added test_replace_part_with_missing_varied_leading_whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gauthier committed Jul 18, 2023
1 parent 6ac2c45 commit 60e49ae
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/test_editblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,26 @@ def test_check_for_ctags_success(self):
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"
Expand Down

0 comments on commit 60e49ae

Please sign in to comment.