Skip to content

Commit a413afe

Browse files
committed
fix testcase due to changed meaning of endposition 0 from PR for
Revision: 751a385 Author: Ekopalypse <[email protected]> Date: 26.03.2023 09:17:55 Message: handle endpos=0 for research and rereplace methods (#283) ---- Modified: PythonScript/src/ScintillaWrapper.cpp
1 parent 751a385 commit a413afe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

PythonScript/python_tests/tests/ReplaceCountTestCase.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ def tearDown(self):
1414
notepad.close()
1515

1616
def test_replace_limit_3(self):
17-
editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 0, 0, 3)
17+
editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 0, -1, 3)
1818
text = editor.getText()
1919
self.assertEqual(text, u'TEST123TEST4567 TEST8910\r\nAbc123\r\n')
2020

2121
def test_replace_limit_2(self):
22-
editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 0, 0, 2)
22+
editor.rereplace(r'([A-Z]{3})', 'TEST', re.IGNORECASE, 0, -1, 2)
2323
text = editor.getText()
2424
self.assertEqual(text, u'TEST123TEST4567 ghi8910\r\nAbc123\r\n')
2525

2626

2727
def test_replace_literal_count_1(self):
28-
editor.replace(r'Abc', 'TEST', re.IGNORECASE, 0, 0, 1)
28+
editor.replace(r'Abc', 'TEST', re.IGNORECASE, 0, -1, 1)
2929
text = editor.getText()
3030
self.assertEqual(text, u'TEST123DEF4567 ghi8910\r\nAbc123\r\n')
3131

0 commit comments

Comments
 (0)