# File test/test_suffix_array.rb, line 13 13: def test_longest_match 14: # go through a simple permutation of the possible suffices and match on them 15: @source.length.times do |i| 16: test_case = @source[i ... @source.length] 17: start, length = @sarray.longest_match test_case, 0 18: assert_equal test_case.length, length, "Match length is wrong" 19: assert_equal test_case, @source[start ... start+length], "Match contents are wrong" 20: end 21: end