comparison src/testdir/test_matchfuzzy.vim @ 22689:f8bf2c122452 v8.2.1893

patch 8.2.1893: fuzzy matching does not support multiple words Commit: https://github.com/vim/vim/commit/8ded5b647aa4b3338da721b343e0bce0f86655f6 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Oct 23 16:50:30 2020 +0200 patch 8.2.1893: fuzzy matching does not support multiple words Problem: Fuzzy matching does not support multiple words. Solution: Add support for matching white space separated words. (Yegappan Lakshmanan, closes #7163)
author Bram Moolenaar <Bram@vim.org>
date Fri, 23 Oct 2020 17:00:04 +0200
parents 0dd527d9c62d
children 875bd7c04533
comparison
equal deleted inserted replaced
22688:a4044d94e557 22689:f8bf2c122452
20 call assert_equal(['oneTwo', 'onetwo'], matchfuzzy(['onetwo', 'oneTwo'], 'oneTwo')) 20 call assert_equal(['oneTwo', 'onetwo'], matchfuzzy(['onetwo', 'oneTwo'], 'oneTwo'))
21 call assert_equal(['onetwo', 'one_two'], matchfuzzy(['onetwo', 'one_two'], 'oneTwo')) 21 call assert_equal(['onetwo', 'one_two'], matchfuzzy(['onetwo', 'one_two'], 'oneTwo'))
22 call assert_equal(['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'], matchfuzzy(['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'], 'aa')) 22 call assert_equal(['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'], matchfuzzy(['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'], 'aa'))
23 call assert_equal(256, matchfuzzy([repeat('a', 256)], repeat('a', 256))[0]->len()) 23 call assert_equal(256, matchfuzzy([repeat('a', 256)], repeat('a', 256))[0]->len())
24 call assert_equal([], matchfuzzy([repeat('a', 300)], repeat('a', 257))) 24 call assert_equal([], matchfuzzy([repeat('a', 300)], repeat('a', 257)))
25 " matches with same score should not be reordered
26 let l = ['abc1', 'abc2', 'abc3']
27 call assert_equal(l, l->matchfuzzy('abc'))
25 28
26 " Tests for match preferences 29 " Tests for match preferences
27 " preference for camel case match 30 " preference for camel case match
28 call assert_equal(['oneTwo', 'onetwo'], ['onetwo', 'oneTwo']->matchfuzzy('onetwo')) 31 call assert_equal(['oneTwo', 'onetwo'], ['onetwo', 'oneTwo']->matchfuzzy('onetwo'))
29 " preference for match after a separator (_ or space) 32 " preference for match after a separator (_ or space)
30 if has("win32") 33 call assert_equal(['onetwo', 'one_two', 'one two'], ['onetwo', 'one_two', 'one two']->matchfuzzy('onetwo'))
31 call assert_equal(['onetwo', 'one two', 'one_two'], ['onetwo', 'one_two', 'one two']->matchfuzzy('onetwo'))
32 else
33 call assert_equal(['onetwo', 'one_two', 'one two'], ['onetwo', 'one_two', 'one two']->matchfuzzy('onetwo'))
34 endif
35 " preference for leading letter match 34 " preference for leading letter match
36 call assert_equal(['onetwo', 'xonetwo'], ['xonetwo', 'onetwo']->matchfuzzy('onetwo')) 35 call assert_equal(['onetwo', 'xonetwo'], ['xonetwo', 'onetwo']->matchfuzzy('onetwo'))
37 " preference for sequential match 36 " preference for sequential match
38 call assert_equal(['onetwo', 'oanbectdweo'], ['oanbectdweo', 'onetwo']->matchfuzzy('onetwo')) 37 call assert_equal(['onetwo', 'oanbectdweo'], ['oanbectdweo', 'onetwo']->matchfuzzy('onetwo'))
39 " non-matching leading letter(s) penalty 38 " non-matching leading letter(s) penalty
40 call assert_equal(['xonetwo', 'xxonetwo'], ['xxonetwo', 'xonetwo']->matchfuzzy('onetwo')) 39 call assert_equal(['xonetwo', 'xxonetwo'], ['xxonetwo', 'xonetwo']->matchfuzzy('onetwo'))
41 " total non-matching letter(s) penalty 40 " total non-matching letter(s) penalty
42 call assert_equal(['one', 'onex', 'onexx'], ['onexx', 'one', 'onex']->matchfuzzy('one')) 41 call assert_equal(['one', 'onex', 'onexx'], ['onexx', 'one', 'onex']->matchfuzzy('one'))
43 " prefer complete matches over separator matches 42 " prefer complete matches over separator matches
44 call assert_equal(['.vim/vimrc', '.vim/vimrc_colors', '.vim/v_i_m_r_c'], ['.vim/vimrc', '.vim/vimrc_colors', '.vim/v_i_m_r_c']->matchfuzzy('vimrc')) 43 call assert_equal(['.vim/vimrc', '.vim/vimrc_colors', '.vim/v_i_m_r_c'], ['.vim/vimrc', '.vim/vimrc_colors', '.vim/v_i_m_r_c']->matchfuzzy('vimrc'))
44 " gap penalty
45 call assert_equal(['xxayybxxxx', 'xxayyybxxx', 'xxayyyybxx'], ['xxayyyybxx', 'xxayyybxxx', 'xxayybxxxx']->matchfuzzy('ab'))
46
47 " match multiple words (separated by space)
48 call assert_equal(['foo bar baz'], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzy('baz foo'))
49 call assert_equal([], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzy('one two'))
50 call assert_equal([], ['foo bar']->matchfuzzy(" \t "))
51
52 " test for matching a sequence of words
53 call assert_equal(['bar foo'], ['foo bar', 'bar foo', 'foobar', 'barfoo']->matchfuzzy('bar foo', {'matchseq' : 1}))
54 call assert_equal([#{text: 'two one'}], [#{text: 'one two'}, #{text: 'two one'}]->matchfuzzy('two one', #{key: 'text', matchseq: v:true}))
45 55
46 %bw! 56 %bw!
47 eval ['somebuf', 'anotherone', 'needle', 'yetanotherone']->map({_, v -> bufadd(v) + bufload(v)}) 57 eval ['somebuf', 'anotherone', 'needle', 'yetanotherone']->map({_, v -> bufadd(v) + bufload(v)})
48 let l = getbufinfo()->map({_, v -> v.name})->matchfuzzy('ndl') 58 let l = getbufinfo()->map({_, v -> v.name})->matchfuzzy('ndl')
49 call assert_equal(1, len(l)) 59 call assert_equal(1, len(l))
50 call assert_match('needle', l[0]) 60 call assert_match('needle', l[0])
51 61
62 " Test for fuzzy matching dicts
52 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}] 63 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}]
53 call assert_equal([{'id' : 6, 'val' : 'camera'}], matchfuzzy(l, 'cam', {'text_cb' : {v -> v.val}})) 64 call assert_equal([{'id' : 6, 'val' : 'camera'}], matchfuzzy(l, 'cam', {'text_cb' : {v -> v.val}}))
54 call assert_equal([{'id' : 6, 'val' : 'camera'}], matchfuzzy(l, 'cam', {'key' : 'val'})) 65 call assert_equal([{'id' : 6, 'val' : 'camera'}], matchfuzzy(l, 'cam', {'key' : 'val'}))
55 call assert_equal([], matchfuzzy(l, 'day', {'text_cb' : {v -> v.val}})) 66 call assert_equal([], matchfuzzy(l, 'day', {'text_cb' : {v -> v.val}}))
56 call assert_equal([], matchfuzzy(l, 'day', {'key' : 'val'})) 67 call assert_equal([], matchfuzzy(l, 'day', {'key' : 'val'}))
62 call assert_fails("let x = matchfuzzy(l, 'cam', {'text_cb' : []})", 'E921:') 73 call assert_fails("let x = matchfuzzy(l, 'cam', {'text_cb' : []})", 'E921:')
63 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : []})", 'E730:') 74 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : []})", 'E730:')
64 call assert_fails("let x = matchfuzzy(l, 'cam', test_null_dict())", 'E715:') 75 call assert_fails("let x = matchfuzzy(l, 'cam', test_null_dict())", 'E715:')
65 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : test_null_string()})", 'E475:') 76 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : test_null_string()})", 'E475:')
66 call assert_fails("let x = matchfuzzy(l, 'foo', {'text_cb' : test_null_function()})", 'E475:') 77 call assert_fails("let x = matchfuzzy(l, 'foo', {'text_cb' : test_null_function()})", 'E475:')
78 " matches with same score should not be reordered
79 let l = [#{text: 'abc', id: 1}, #{text: 'abc', id: 2}, #{text: 'abc', id: 3}]
80 call assert_equal(l, l->matchfuzzy('abc', #{key: 'text'}))
67 81
68 let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}] 82 let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}]
69 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : 'name'})", 'E730:') 83 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : 'name'})", 'E730:')
70 84
71 " Test in latin1 encoding 85 " Test in latin1 encoding
73 set encoding=latin1 87 set encoding=latin1
74 call assert_equal(['abc'], matchfuzzy(['abc'], 'abc')) 88 call assert_equal(['abc'], matchfuzzy(['abc'], 'abc'))
75 let &encoding = save_enc 89 let &encoding = save_enc
76 endfunc 90 endfunc
77 91
78 " Test for the fuzzymatchpos() function 92 " Test for the matchfuzzypos() function
79 func Test_matchfuzzypos() 93 func Test_matchfuzzypos()
80 call assert_equal([['curl', 'world'], [[2,3], [2,3]]], matchfuzzypos(['world', 'curl'], 'rl')) 94 call assert_equal([['curl', 'world'], [[2,3], [2,3]]], matchfuzzypos(['world', 'curl'], 'rl'))
81 call assert_equal([['curl', 'world'], [[2,3], [2,3]]], matchfuzzypos(['world', 'one', 'curl'], 'rl')) 95 call assert_equal([['curl', 'world'], [[2,3], [2,3]]], matchfuzzypos(['world', 'one', 'curl'], 'rl'))
82 call assert_equal([['hello', 'hello world hello world'], 96 call assert_equal([['hello', 'hello world hello world'],
83 \ [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]]], 97 \ [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]]],
84 \ matchfuzzypos(['hello world hello world', 'hello', 'world'], 'hello')) 98 \ matchfuzzypos(['hello world hello world', 'hello', 'world'], 'hello'))
85 call assert_equal([['aaaaaaa'], [[0, 1, 2]]], matchfuzzypos(['aaaaaaa'], 'aaa')) 99 call assert_equal([['aaaaaaa'], [[0, 1, 2]]], matchfuzzypos(['aaaaaaa'], 'aaa'))
100 call assert_equal([['a b'], [[0, 3]]], matchfuzzypos(['a b'], 'a b'))
101 call assert_equal([['a b'], [[0, 3]]], matchfuzzypos(['a b'], 'a b'))
102 call assert_equal([['a b'], [[0]]], matchfuzzypos(['a b'], ' a '))
103 call assert_equal([[], []], matchfuzzypos(['a b'], ' '))
86 call assert_equal([[], []], matchfuzzypos(['world', 'curl'], 'ab')) 104 call assert_equal([[], []], matchfuzzypos(['world', 'curl'], 'ab'))
87 let x = matchfuzzypos([repeat('a', 256)], repeat('a', 256)) 105 let x = matchfuzzypos([repeat('a', 256)], repeat('a', 256))
88 call assert_equal(range(256), x[1][0]) 106 call assert_equal(range(256), x[1][0])
89 call assert_equal([[], []], matchfuzzypos([repeat('a', 300)], repeat('a', 257))) 107 call assert_equal([[], []], matchfuzzypos([repeat('a', 300)], repeat('a', 257)))
90 call assert_equal([[], []], matchfuzzypos([], 'abc')) 108 call assert_equal([[], []], matchfuzzypos([], 'abc'))
101 call assert_equal([['abcxabc'], [[0, 1]]], matchfuzzypos(['abcxabc'], 'ab')) 119 call assert_equal([['abcxabc'], [[0, 1]]], matchfuzzypos(['abcxabc'], 'ab'))
102 " preference for sequential match 120 " preference for sequential match
103 call assert_equal([['aobncedone'], [[7, 8, 9]]], matchfuzzypos(['aobncedone'], 'one')) 121 call assert_equal([['aobncedone'], [[7, 8, 9]]], matchfuzzypos(['aobncedone'], 'one'))
104 " best recursive match 122 " best recursive match
105 call assert_equal([['xoone'], [[2, 3, 4]]], matchfuzzypos(['xoone'], 'one')) 123 call assert_equal([['xoone'], [[2, 3, 4]]], matchfuzzypos(['xoone'], 'one'))
124
125 " match multiple words (separated by space)
126 call assert_equal([['foo bar baz'], [[8, 9, 10, 0, 1, 2]]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo'))
127 call assert_equal([[], []], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('one two'))
128 call assert_equal([[], []], ['foo bar']->matchfuzzypos(" \t "))
129 call assert_equal([['grace'], [[1, 2, 3, 4, 2, 3, 4, 0, 1, 2, 3, 4]]], ['grace']->matchfuzzypos('race ace grace'))
106 130
107 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}] 131 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}]
108 call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]]], 132 call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]]],
109 \ matchfuzzypos(l, 'cam', {'text_cb' : {v -> v.val}})) 133 \ matchfuzzypos(l, 'cam', {'text_cb' : {v -> v.val}}))
110 call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]]], 134 call assert_equal([[{'id' : 6, 'val' : 'camera'}], [[0, 1, 2]]],
124 148
125 let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}] 149 let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}]
126 call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : 'name'})", 'E730:') 150 call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : 'name'})", 'E730:')
127 endfunc 151 endfunc
128 152
153 " Test for matchfuzzy() with multibyte characters
129 func Test_matchfuzzy_mbyte() 154 func Test_matchfuzzy_mbyte()
130 CheckFeature multi_lang 155 CheckFeature multi_lang
131 call assert_equal(['ンヹㄇヺヴ'], matchfuzzy(['ンヹㄇヺヴ'], 'ヹヺ')) 156 call assert_equal(['ンヹㄇヺヴ'], matchfuzzy(['ンヹㄇヺヴ'], 'ヹヺ'))
132 " reverse the order of characters 157 " reverse the order of characters
133 call assert_equal([], matchfuzzy(['ンヹㄇヺヴ'], 'ヺヹ')) 158 call assert_equal([], matchfuzzy(['ンヹㄇヺヴ'], 'ヺヹ'))
134 call assert_equal(['αβΩxxx', 'xαxβxΩx'], 159 call assert_equal(['αβΩxxx', 'xαxβxΩx'],
135 \ matchfuzzy(['αβΩxxx', 'xαxβxΩx'], 'αβΩ')) 160 \ matchfuzzy(['αβΩxxx', 'xαxβxΩx'], 'αβΩ'))
136 call assert_equal(['ππbbππ', 'πππbbbπππ', 'ππππbbbbππππ', 'πbπ'], 161 call assert_equal(['ππbbππ', 'πππbbbπππ', 'ππππbbbbππππ', 'πbπ'],
137 \ matchfuzzy(['πbπ', 'ππbbππ', 'πππbbbπππ', 'ππππbbbbππππ'], 'ππ')) 162 \ matchfuzzy(['πbπ', 'ππbbππ', 'πππbbbπππ', 'ππππbbbbππππ'], 'ππ'))
138 163
164 " match multiple words (separated by space)
165 call assert_equal(['세 마리의 작은 돼지'], ['세 마리의 작은 돼지', '마리의', '마리의 작은', '작은 돼지']->matchfuzzy('돼지 마리의'))
166 call assert_equal([], ['세 마리의 작은 돼지', '마리의', '마리의 작은', '작은 돼지']->matchfuzzy('파란 하늘'))
167
139 " preference for camel case match 168 " preference for camel case match
140 call assert_equal(['oneĄwo', 'oneąwo'], 169 call assert_equal(['oneĄwo', 'oneąwo'],
141 \ ['oneąwo', 'oneĄwo']->matchfuzzy('oneąwo')) 170 \ ['oneąwo', 'oneĄwo']->matchfuzzy('oneąwo'))
142 " preference for complete match then match after separator (_ or space) 171 " preference for complete match then match after separator (_ or space)
143 if has("win32") 172 call assert_equal(['ⅠⅡabㄟㄠ'] + sort(['ⅠⅡa_bㄟㄠ', 'ⅠⅡa bㄟㄠ']),
144 " order is different between Windows and Unix :(
145 " It's important that the complete match is first
146 call assert_equal(['ⅠⅡabㄟㄠ', 'ⅠⅡa bㄟㄠ', 'ⅠⅡa_bㄟㄠ'],
147 \ ['ⅠⅡabㄟㄠ', 'ⅠⅡa_bㄟㄠ', 'ⅠⅡa bㄟㄠ']->matchfuzzy('ⅠⅡabㄟㄠ'))
148 else
149 call assert_equal(['ⅠⅡabㄟㄠ'] + sort(['ⅠⅡa_bㄟㄠ', 'ⅠⅡa bㄟㄠ']),
150 \ ['ⅠⅡabㄟㄠ', 'ⅠⅡa bㄟㄠ', 'ⅠⅡa_bㄟㄠ']->matchfuzzy('ⅠⅡabㄟㄠ')) 173 \ ['ⅠⅡabㄟㄠ', 'ⅠⅡa bㄟㄠ', 'ⅠⅡa_bㄟㄠ']->matchfuzzy('ⅠⅡabㄟㄠ'))
151 endif 174 " preference for match after a separator (_ or space)
175 call assert_equal(['ㄓㄔabㄟㄠ', 'ㄓㄔa_bㄟㄠ', 'ㄓㄔa bㄟㄠ'],
176 \ ['ㄓㄔa_bㄟㄠ', 'ㄓㄔa bㄟㄠ', 'ㄓㄔabㄟㄠ']->matchfuzzy('ㄓㄔabㄟㄠ'))
152 " preference for leading letter match 177 " preference for leading letter match
153 call assert_equal(['ŗŝţũŵż', 'xŗŝţũŵż'], 178 call assert_equal(['ŗŝţũŵż', 'xŗŝţũŵż'],
154 \ ['xŗŝţũŵż', 'ŗŝţũŵż']->matchfuzzy('ŗŝţũŵż')) 179 \ ['xŗŝţũŵż', 'ŗŝţũŵż']->matchfuzzy('ŗŝţũŵż'))
155 " preference for sequential match 180 " preference for sequential match
156 call assert_equal(['ㄞㄡㄤfffifl', 'ㄞaㄡbㄤcffdfiefl'], 181 call assert_equal(['ㄞㄡㄤfffifl', 'ㄞaㄡbㄤcffdfiefl'],
161 " total non-matching letter(s) penalty 186 " total non-matching letter(s) penalty
162 call assert_equal(['ŗŝţ', 'ŗŝţx', 'ŗŝţxx'], 187 call assert_equal(['ŗŝţ', 'ŗŝţx', 'ŗŝţxx'],
163 \ ['ŗŝţxx', 'ŗŝţ', 'ŗŝţx']->matchfuzzy('ŗŝţ')) 188 \ ['ŗŝţxx', 'ŗŝţ', 'ŗŝţx']->matchfuzzy('ŗŝţ'))
164 endfunc 189 endfunc
165 190
191 " Test for matchfuzzypos() with multibyte characters
166 func Test_matchfuzzypos_mbyte() 192 func Test_matchfuzzypos_mbyte()
167 CheckFeature multi_lang 193 CheckFeature multi_lang
168 call assert_equal([['こんにちは世界'], [[0, 1, 2, 3, 4]]], 194 call assert_equal([['こんにちは世界'], [[0, 1, 2, 3, 4]]],
169 \ matchfuzzypos(['こんにちは世界'], 'こんにちは')) 195 \ matchfuzzypos(['こんにちは世界'], 'こんにちは'))
170 call assert_equal([['ンヹㄇヺヴ'], [[1, 3]]], matchfuzzypos(['ンヹㄇヺヴ'], 'ヹヺ')) 196 call assert_equal([['ンヹㄇヺヴ'], [[1, 3]]], matchfuzzypos(['ンヹㄇヺヴ'], 'ヹヺ'))
181 call assert_equal([[], []], matchfuzzypos(['ンヹㄇ', 'ŗŝţ'], 'fffifl')) 207 call assert_equal([[], []], matchfuzzypos(['ンヹㄇ', 'ŗŝţ'], 'fffifl'))
182 let x = matchfuzzypos([repeat('Ψ', 256)], repeat('Ψ', 256)) 208 let x = matchfuzzypos([repeat('Ψ', 256)], repeat('Ψ', 256))
183 call assert_equal(range(256), x[1][0]) 209 call assert_equal(range(256), x[1][0])
184 call assert_equal([[], []], matchfuzzypos([repeat('✓', 300)], repeat('✓', 257))) 210 call assert_equal([[], []], matchfuzzypos([repeat('✓', 300)], repeat('✓', 257)))
185 211
212 " match multiple words (separated by space)
213 call assert_equal([['세 마리의 작은 돼지'], [[9, 10, 2, 3, 4]]], ['세 마리의 작은 돼지', '마리의', '마리의 작은', '작은 돼지']->matchfuzzypos('돼지 마리의'))
214 call assert_equal([[], []], ['세 마리의 작은 돼지', '마리의', '마리의 작은', '작은 돼지']->matchfuzzypos('파란 하늘'))
215
186 " match in a long string 216 " match in a long string
187 call assert_equal([[repeat('♪', 300) .. '✗✗✗'], [[300, 301, 302]]], 217 call assert_equal([[repeat('ぶ', 300) .. 'ẼẼẼ'], [[300, 301, 302]]],
188 \ matchfuzzypos([repeat('♪', 300) .. '✗✗✗'], '✗✗✗')) 218 \ matchfuzzypos([repeat('ぶ', 300) .. 'ẼẼẼ'], 'ẼẼẼ'))
189 " preference for camel case match 219 " preference for camel case match
190 call assert_equal([['xѳѵҁxxѳѴҁ'], [[6, 7, 8]]], matchfuzzypos(['xѳѵҁxxѳѴҁ'], 'ѳѵҁ')) 220 call assert_equal([['xѳѵҁxxѳѴҁ'], [[6, 7, 8]]], matchfuzzypos(['xѳѵҁxxѳѴҁ'], 'ѳѵҁ'))
191 " preference for match after a separator (_ or space) 221 " preference for match after a separator (_ or space)
192 call assert_equal([['xちだx_ちだ'], [[5, 6]]], matchfuzzypos(['xちだx_ちだ'], 'ちだ')) 222 call assert_equal([['xちだx_ちだ'], [[5, 6]]], matchfuzzypos(['xちだx_ちだ'], 'ちだ'))
193 " preference for leading letter match 223 " preference for leading letter match