Mercurial > vim
comparison src/testdir/test_matchfuzzy.vim @ 29375:209420b9d2dd v9.0.0030
patch 9.0.0030: matchfuzzy test depends on path of current directory
Commit: https://github.com/vim/vim/commit/22e7e867e224596bd758260e4278ce6239c35ba5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 2 20:48:01 2022 +0100
patch 9.0.0030: matchfuzzy test depends on path of current directory
Problem: Matchfuzzy test depends on path of current directory.
Solution: Use fnamemodify() to remove the path. (Robin Becker,
closes #10650)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 02 Jul 2022 22:00:02 +0200 |
parents | f92f658585e6 |
children | 86eb4aba16c3 |
comparison
equal
deleted
inserted
replaced
29374:f3013ca27dc8 | 29375:209420b9d2dd |
---|---|
55 call assert_equal(['bar foo'], ['foo bar', 'bar foo', 'foobar', 'barfoo']->matchfuzzy('bar foo', {'matchseq' : 1})) | 55 call assert_equal(['bar foo'], ['foo bar', 'bar foo', 'foobar', 'barfoo']->matchfuzzy('bar foo', {'matchseq' : 1})) |
56 call assert_equal([#{text: 'two one'}], [#{text: 'one two'}, #{text: 'two one'}]->matchfuzzy('two one', #{key: 'text', matchseq: v:true})) | 56 call assert_equal([#{text: 'two one'}], [#{text: 'one two'}, #{text: 'two one'}]->matchfuzzy('two one', #{key: 'text', matchseq: v:true})) |
57 | 57 |
58 %bw! | 58 %bw! |
59 eval ['somebuf', 'anotherone', 'needle', 'yetanotherone']->map({_, v -> bufadd(v) + bufload(v)}) | 59 eval ['somebuf', 'anotherone', 'needle', 'yetanotherone']->map({_, v -> bufadd(v) + bufload(v)}) |
60 let l = getbufinfo()->map({_, v -> v.name})->matchfuzzy('ndl') | 60 let l = getbufinfo()->map({_, v -> fnamemodify(v.name, ':t')})->matchfuzzy('ndl') |
61 call assert_equal(1, len(l)) | 61 call assert_equal(1, len(l)) |
62 call assert_match('needle', l[0]) | 62 call assert_match('needle', l[0]) |
63 | 63 |
64 " Test for fuzzy matching dicts | 64 " Test for fuzzy matching dicts |
65 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}] | 65 let l = [{'id' : 5, 'val' : 'crayon'}, {'id' : 6, 'val' : 'camera'}] |