def test_substring_binary_search_with_2_chars_substring(self): text = "defg" substring = "ef" expected = 1 computed = substring_binary_search(text, substring) self.assertEquals(computed, expected)
def test_substring_binary_search_empty_text(self): text = "" substring = "$" expected = -1 computed = substring_binary_search(text, substring) self.assertEquals(computed, expected)
def test_substring_binary_search_without_1_char_substring(self): text = "abc" substring = "d" expected = -1 computed = substring_binary_search(text, substring) self.assertEquals(computed, expected)
def test_substring_binary_search_without_2_chars_substring(self): text = "hijk" substring = "lmn" expected = -1 computed = substring_binary_search(text, substring) self.assertEquals(computed, expected)