This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
kse-02/tests/test_rabin_karp_search.py
2023-12-09 17:56:51 +01:00

20 lines
No EOL
642 B
Python

from unittest import TestCase
from benchmark.rabin_karp import rabin_karp_search
class Test_rabin_karp_search(TestCase):
def test_rabin_karp_search_1(self):
assert rabin_karp_search(pat='', txt='m 2') == []
def test_rabin_karp_search_2(self):
assert rabin_karp_search(pat='.w5', txt='55[Ax5X') == []
def test_rabin_karp_search_3(self):
assert rabin_karp_search(pat='h@=y', txt='JcEC') == []
def test_rabin_karp_search_4(self):
assert rabin_karp_search(pat='X', txt='J@X"') == [2]
def test_rabin_karp_search_5(self):
assert rabin_karp_search(pat='>0OPQ', txt='Dzxu8:(P') == []