comparison src/testdir/test_matchfuzzy.vim @ 28831:b5c46d447518 v8.2.4939

patch 8.2.4939: matchfuzzypos() with "matchseq" does not have all positions Commit: https://github.com/vim/vim/commit/9af2bc075169e14fd06ed967d28eac7206d21f36 Author: zeertzjq <zeertzjq@outlook.com> Date: Wed May 11 14:15:37 2022 +0100 patch 8.2.4939: matchfuzzypos() with "matchseq" does not have all positions Problem: matchfuzzypos() with "matchseq" does not have all positions. Solution: Also add a position for white space. (closes https://github.com/vim/vim/issues/10404)
author Bram Moolenaar <Bram@vim.org>
date Wed, 11 May 2022 15:30:03 +0200
parents 2ade724b3f45
children f92f658585e6
comparison
equal deleted inserted replaced
28830:405c5cf665b0 28831:b5c46d447518
124 " best recursive match 124 " best recursive match
125 call assert_equal([['xoone'], [[2, 3, 4]], [168]], matchfuzzypos(['xoone'], 'one')) 125 call assert_equal([['xoone'], [[2, 3, 4]], [168]], matchfuzzypos(['xoone'], 'one'))
126 126
127 " match multiple words (separated by space) 127 " match multiple words (separated by space)
128 call assert_equal([['foo bar baz'], [[8, 9, 10, 0, 1, 2]], [369]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo')) 128 call assert_equal([['foo bar baz'], [[8, 9, 10, 0, 1, 2]], [369]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo'))
129 call assert_equal([[], [], []], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('baz foo', {'matchseq': 1}))
130 call assert_equal([['foo bar baz'], [[0, 1, 2, 8, 9, 10]], [369]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz'))
131 call assert_equal([['foo bar baz'], [[0, 1, 2, 3, 4, 5, 10]], [326]], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('foo baz', {'matchseq': 1}))
129 call assert_equal([[], [], []], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('one two')) 132 call assert_equal([[], [], []], ['foo bar baz', 'foo', 'foo bar', 'baz bar']->matchfuzzypos('one two'))
130 call assert_equal([[], [], []], ['foo bar']->matchfuzzypos(" \t ")) 133 call assert_equal([[], [], []], ['foo bar']->matchfuzzypos(" \t "))
131 call assert_equal([['grace'], [[1, 2, 3, 4, 2, 3, 4, 0, 1, 2, 3, 4]], [657]], ['grace']->matchfuzzypos('race ace grace')) 134 call assert_equal([['grace'], [[1, 2, 3, 4, 2, 3, 4, 0, 1, 2, 3, 4]], [657]], ['grace']->matchfuzzypos('race ace grace'))
132 135
133 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}] 136 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}]