aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-10 21:04:41 +0800
committerGitHub <noreply@github.com>2022-02-10 21:04:41 +0800
commita73360a09a54c186f2df6e167a8be1f1a1d8c62a (patch)
treed3cdf0384ceeb812c505fc9e8e82856231a0b301 /src/nvim/testdir
parent3b4bf887104465fc7e821939ccbc44e9884a7d06 (diff)
parentc415e764d424251bb8139dcdd793b7b716aec563 (diff)
downloadrneovim-a73360a09a54c186f2df6e167a8be1f1a1d8c62a.tar.gz
rneovim-a73360a09a54c186f2df6e167a8be1f1a1d8c62a.tar.bz2
rneovim-a73360a09a54c186f2df6e167a8be1f1a1d8c62a.zip
Merge pull request #16868 from zeertzjq/vim-8.1.2221
vim-patch:8.1.2221,8.2.4336: filtering for :disp and :scriptnames
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_filter_cmd.vim35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_filter_cmd.vim b/src/nvim/testdir/test_filter_cmd.vim
index 0c45db049b..d465e48c7b 100644
--- a/src/nvim/testdir/test_filter_cmd.vim
+++ b/src/nvim/testdir/test_filter_cmd.vim
@@ -145,3 +145,38 @@ func Test_filter_commands()
bwipe! file.h
bwipe! file.hs
endfunc
+
+func Test_filter_display()
+ edit Xdoesnotmatch
+ let @a = '!!willmatch'
+ let @b = '!!doesnotmatch'
+ let @c = "oneline\ntwoline\nwillmatch\n"
+ let @/ = '!!doesnotmatch'
+ call feedkeys(":echo '!!doesnotmatch:'\<CR>", 'ntx')
+ let lines = map(split(execute('filter /willmatch/ display'), "\n"), 'v:val[5:6]')
+
+ call assert_true(index(lines, '"a') >= 0)
+ call assert_false(index(lines, '"b') >= 0)
+ call assert_true(index(lines, '"c') >= 0)
+ call assert_false(index(lines, '"/') >= 0)
+ call assert_false(index(lines, '":') >= 0)
+ call assert_false(index(lines, '"%') >= 0)
+
+ let lines = map(split(execute('filter /doesnotmatch/ display'), "\n"), 'v:val[5:6]')
+ call assert_true(index(lines, '"a') < 0)
+ call assert_false(index(lines, '"b') < 0)
+ call assert_true(index(lines, '"c') < 0)
+ call assert_false(index(lines, '"/') < 0)
+ call assert_false(index(lines, '":') < 0)
+ call assert_false(index(lines, '"%') < 0)
+
+ bwipe!
+endfunc
+
+func Test_filter_scriptnames()
+ let lines = split(execute('filter /test_filter_cmd/ scriptnames'), "\n")
+ call assert_equal(1, len(lines))
+ call assert_match('filter_cmd', lines[0])
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab