# File test/test_suffix_array.rb, line 24
24:         def test_longest_nonmatch
25:             # go through the same matching permutation, but use a non-match string at the front
26:             # to test the nonmatch algorithm, but we turn off short match encoding
27:             nonmatch = "XXXXXXXXXX"
28:             short_match = 0
29:             @source.length.times do |i|
30:                 test_case = nonmatch + @source[i ... @source.length]
31:                 nonmatch_len, match_start, match_len = @sarray.longest_nonmatch test_case, 0, short_match
32:                 nm = test_case[0 ... nonmatch_len]
33: 
34:                 assert_equal nm, nonmatch, "Non-match regions not equal"
35:                 assert_equal @source.length-i, match_len, "Match length is wrong #{nm.length}, #{match_len}"
36:                 assert_equal @source[i ... i+match_len], @source[match_start ... match_start+match_len], "Match contents are wrong"
37:             end
38:         end