summaryrefslogtreecommitdiff
path: root/src/testdir/test_filter_cmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-23 23:51:21 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-23 23:51:21 +0200
commit7b668e83d0635d082b7ec90d7d2aa30a9d7d8928 (patch)
tree5a766b46ad4395652cfe4d2545ee809047384fc9 /src/testdir/test_filter_cmd.vim
parent1b58cdd160c2e0ada0f638679a2aa27e4665fc48 (diff)
downloadvim-git-7b668e83d0635d082b7ec90d7d2aa30a9d7d8928.tar.gz
patch 7.4.2244v7.4.2244
Problem: Adding pattern to ":oldfiles" is not a generic solution. Solution: Add the ":filter /pat/ cmd" command modifier. Only works for some commands right now.
Diffstat (limited to 'src/testdir/test_filter_cmd.vim')
-rw-r--r--src/testdir/test_filter_cmd.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_filter_cmd.vim b/src/testdir/test_filter_cmd.vim
new file mode 100644
index 000000000..f85a11ce4
--- /dev/null
+++ b/src/testdir/test_filter_cmd.vim
@@ -0,0 +1,15 @@
+" Test the :filter command modifier
+
+func Test_filter()
+ edit Xdoesnotmatch
+ edit Xwillmatch
+ call assert_equal('"Xwillmatch"', substitute(execute('filter willma ls'), '[^"]*\(".*"\)[^"]*', '\1', ''))
+endfunc
+
+func Test_filter_fails()
+ call assert_fails('filter', 'E471:')
+ call assert_fails('filter pat', 'E476:')
+ call assert_fails('filter /pat', 'E476:')
+ call assert_fails('filter /pat/', 'E476:')
+ call assert_fails('filter /pat/ asdf', 'E492:')
+endfunc