improved index_of_with_escape
Some checks are pending
CI / build (push) Waiting to run

This commit is contained in:
2024-11-18 09:00:23 +08:00
parent 36f7031fea
commit 79246f70c4
2 changed files with 9 additions and 5 deletions

View File

@@ -104,7 +104,7 @@ class TestIndexOfWithEscape(unittest.TestCase):
break
solution.append(i)
i += 1
self.assertEqual(solution, expected_solution)
self.assertEqual(expected_solution, solution)
def test_simple(self):
self.run_test_case(" dsds $sdsa \\$dfivbdsf \\\\$sdgsga", '$', '\\', [6, 25])
@@ -124,4 +124,6 @@ class TestIndexOfWithEscape(unittest.TestCase):
def test_special_case(self):
self.run_test_case("\n${sys:user.home}${env:HOME}", ':', '\\', [6, 22])
def test_wide_needle(self):
self.run_test_case("asdasd\\${#vdfv|${#sdfs}", '${', '\\', [15])