diff src/testdir/test_cmdline.vim @ 9774:5385e72e1ac2 v7.4.2162

commit https://github.com/vim/vim/commit/7522f6982197f83a5c0f6e9af07fb713934f824a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 6 14:12:50 2016 +0200 patch 7.4.2162 Problem: Result of getcompletion('', 'sign') depends on previous completion. Solution: Call set_context_in_sign_cmd(). (Dominique Pelle)
author Christian Brabandt <cb@256bit.org>
date Sat, 06 Aug 2016 14:15:04 +0200
parents be9b5f8c3fd9
children 74f67cb4f7e1
line wrap: on
line diff
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -138,6 +138,19 @@ func Test_getcompletion()
     call assert_equal(keys, l)
   endif
 
+  if has('signs')
+    sign define Testing linehl=Comment
+    let l = getcompletion('', 'sign')
+    let cmds = ['define', 'jump', 'list', 'place', 'undefine', 'unplace']
+    call assert_equal(cmds, l)
+    " using cmdline completion must not change the result
+    call feedkeys(":sign list \<c-d>\<c-c>", 'xt')
+    let l = getcompletion('', 'sign')
+    call assert_equal(cmds, l)
+    let l = getcompletion('list ', 'sign')
+    call assert_equal(['Testing'], l)
+  endif
+
   " For others test if the name is recognized.
   let names = ['buffer', 'environment', 'file_in_path',
 	\ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user']
@@ -150,9 +163,6 @@ func Test_getcompletion()
   if has('profile')
     call add(names, 'syntime')
   endif
-  if has('signs')
-    call add(names, 'sign')
-  endif
 
   set tags=Xtags
   call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", "word\tfile\tcmd"], 'Xtags')