Lines Matching refs:l
26 let l = ['abc1', 'abc2', 'abc3']
27 call assert_equal(l, l->matchfuzzy('abc'))
60 let l = getbufinfo()->map({_, v -> v.name})->matchfuzzy('ndl')
61 call assert_equal(1, len(l))
62 call assert_match('needle', l[0])
65 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}]
66 …call assert_equal([{'id' : 6, 'val' : 'camera'}], matchfuzzy(l, 'cam', {'text_cb' : {v -> v.val}}))
67 call assert_equal([{'id' : 6, 'val' : 'camera'}], matchfuzzy(l, 'cam', {'key' : 'val'}))
68 call assert_equal([], matchfuzzy(l, 'day', {'text_cb' : {v -> v.val}}))
69 call assert_equal([], matchfuzzy(l, 'day', {'key' : 'val'}))
70 call assert_fails("let x = matchfuzzy(l, 'cam', 'random')", 'E715:')
71 call assert_equal([], matchfuzzy(l, 'day', {'text_cb' : {v -> []}}))
72 call assert_equal([], matchfuzzy(l, 'day', {'text_cb' : {v -> 1}}))
73 call assert_fails("let x = matchfuzzy(l, 'day', {'text_cb' : {a, b -> 1}})", 'E119:')
74 call assert_equal([], matchfuzzy(l, 'cam'))
75 call assert_fails("let x = matchfuzzy(l, 'cam', {'text_cb' : []})", 'E921:')
76 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : []})", 'E730:')
77 call assert_fails("let x = matchfuzzy(l, 'cam', test_null_dict())", 'E715:')
78 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : test_null_string()})", 'E475:')
79 call assert_fails("let x = matchfuzzy(l, 'foo', {'text_cb' : test_null_function()})", 'E475:')
81 let l = [#{text: 'abc', id: 1}, #{text: 'abc', id: 2}, #{text: 'abc', id: 3}]
82 call assert_equal(l, l->matchfuzzy('abc', #{key: 'text'}))
84 let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}]
85 call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : 'name'})", 'E730:')
133 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}]
135 \ matchfuzzypos(l, 'cam', {'text_cb' : {v -> v.val}}))
137 \ matchfuzzypos(l, 'cam', {'key' : 'val'}))
138 call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'text_cb' : {v -> v.val}}))
139 call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'key' : 'val'}))
140 call assert_fails("let x = matchfuzzypos(l, 'cam', 'random')", 'E715:')
141 call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'text_cb' : {v -> []}}))
142 call assert_equal([[], [], []], matchfuzzypos(l, 'day', {'text_cb' : {v -> 1}}))
143 call assert_fails("let x = matchfuzzypos(l, 'day', {'text_cb' : {a, b -> 1}})", 'E119:')
144 call assert_equal([[], [], []], matchfuzzypos(l, 'cam'))
145 call assert_fails("let x = matchfuzzypos(l, 'cam', {'text_cb' : []})", 'E921:')
146 call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : []})", 'E730:')
147 call assert_fails("let x = matchfuzzypos(l, 'cam', test_null_dict())", 'E715:')
148 call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : test_null_string()})", 'E475:')
149 call assert_fails("let x = matchfuzzypos(l, 'foo', {'text_cb' : test_null_function()})", 'E475:')
151 let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}]
152 call assert_fails("let x = matchfuzzypos(l, 'foo', {'key' : 'name'})", 'E730:')