from unittest import TestCase
from benchmark.rabin_karp import rabin_karp_search
class Test_rabin_karp_search(TestCase):
# distances_true = {1: [0], 2: [1, 0], 3: [1], 4: [1]}
# distances_false = {1: [1], 2: [0, 4], 3: [0], 4: [0]}
def test_rabin_karp_search_1(self):
assert rabin_karp_search(pat='A@@', txt='A<g') == []
# distances_true = {1: [28], 4: [1]}
# distances_false = {1: [0], 4: [0]}
def test_rabin_karp_search_2(self):
assert rabin_karp_search(pat='RC)', txt='][`') == []
# distances_true = {1: [0], 2: [0], 3: [2], 4: [1]}
# distances_false = {1: [1], 2: [25], 3: [0], 4: [0]}
def test_rabin_karp_search_3(self):
assert rabin_karp_search(pat='*3~', txt='C9`') == []