MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_find_with_memory

Method test_find_with_memory

Lib/test/string_tests.py:378–386  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

376 self.checkequal(1, haystack + needle, 'count', needle)
377
378 def test_find_with_memory(self):
379 # Test the "Skip with memory" path in the two-way algorithm.
380 for N in 1000, 3000, 10_000, 30_000:
381 needle = 'ab' * N
382 haystack = ('ab'*(N-1) + 'b') * 2
383 self.checkequal(-1, haystack, 'find', needle)
384 self.checkequal(0, haystack, 'count', needle)
385 self.checkequal(len(haystack), haystack + needle, 'find', needle)
386 self.checkequal(1, haystack + needle, 'count', needle)
387
388 def test_find_shift_table_overflow(self):
389 """When the table of 8-bit shifts overflows."""

Callers

nothing calls this directly

Calls 2

checkequalMethod · 0.95
lenFunction · 0.85

Tested by

no test coverage detected