def test_get_lcp_array_for_mississipi(self): text = "mississippi$" suffix_array = [11, 10, 7, 4, 1, 0, 9, 8, 6, 3, 5, 2] lcp_array_expected = [0, 0, 1, 1, 4, 0, 0, 1, 0, 2, 1, 3] lcp_array_computed = compute_lcp_array(text, suffix_array) self.assertEquals(lcp_array_computed, lcp_array_expected)
def test_get_lcp_array_for_abracadabra(self): text = "abracadabra$" suffix_array = [11, 10, 7, 0, 3, 5, 8, 1, 4, 6, 9, 2] lcp_array_expected = [0, 0, 1, 4, 1, 1, 0, 3, 0, 0, 0, 2] lcp_array_computed = compute_lcp_array(text, suffix_array) self.assertEquals(lcp_array_computed, lcp_array_expected)