diff src/testdir/test_cmdline.vim @ 9460:cdffa812f9d1 v7.4.2011

commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 9 18:50:29 2016 +0200 patch 7.4.2011 Problem: It is not easy to get a list of command arguments. Solution: Add getcompletion(). (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Sat, 09 Jul 2016 19:00:06 +0200
parents f92cfcd7fda2
children 7384c0cfad13
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -24,3 +24,19 @@ func Test_complete_wildmenu()
   call delete('Xtestfile2')
   set nowildmenu
 endfunc
+
+func Test_getcompletion()
+  let groupcount = len(getcompletion('', 'event'))
+  call assert_true(groupcount > 0)
+  let matchcount = len(getcompletion('File', 'event'))
+  call assert_true(matchcount > 0)
+  call assert_true(groupcount > matchcount)
+
+  source $VIMRUNTIME/menu.vim
+  let matchcount = len(getcompletion('', 'menu'))
+  call assert_true(matchcount > 0)
+  let matchcount = len(getcompletion('ToolBar.', 'menu'))
+  call assert_true(matchcount > 0)
+
+  call assert_fails('call getcompletion("", "burp")', 'E475:')
+endfunc