]> granicus.if.org Git - vim/commitdiff
patch 7.4.2012 v7.4.2012
authorBram Moolenaar <Bram@vim.org>
Sat, 9 Jul 2016 17:20:59 +0000 (19:20 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 9 Jul 2016 17:20:59 +0000 (19:20 +0200)
Problem:    Test for getcompletion() does not pass on all systems.
Solution:   Only test what is supported.

src/testdir/test_cmdline.vim
src/version.c

index 30d366b1e6eaf132b8d673fb1de60e4242ace1f0..3482153237eeaacd1af8462f20f89510831d91c2 100644 (file)
@@ -26,17 +26,24 @@ func Test_complete_wildmenu()
 endfunc
 
 func Test_getcompletion()
+  if !has('cmdline_compl')
+    return
+  endif
   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)
+  if has('menu')
+    source $VIMRUNTIME/menu.vim
+    let matchcount = len(getcompletion('', 'menu'))
+    call assert_true(matchcount > 0)
+    call assert_equal(['File.'], getcompletion('File', 'menu'))
+    call assert_true(matchcount > 0)
+    let matchcount = len(getcompletion('File.', 'menu'))
+    call assert_true(matchcount > 0)
+  endif
 
   call assert_fails('call getcompletion("", "burp")', 'E475:')
 endfunc
index 33cfc57523009b883e84ef4da39c2a2ddcbc9887..39331b6c19bb7c74b18cf8e0a4f61965719b2002 100644 (file)
@@ -758,6 +758,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2012,
 /**/
     2011,
 /**/