(self)
| 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.""" |
nothing calls this directly
no test coverage detected