diff src/testdir/test_usercommands.vim @ 19724:b3e93a05c3ca v8.2.0418

patch 8.2.0418: code in eval.c not sufficiently covered by tests Commit: https://github.com/vim/vim/commit/8b633135106dda8605463b780573c45b00c22afe Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 20 18:20:51 2020 +0100 patch 8.2.0418: code in eval.c not sufficiently covered by tests Problem: Code in eval.c not sufficiently covered by tests. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5815)
author Bram Moolenaar <Bram@vim.org>
date Fri, 20 Mar 2020 18:30:05 +0100
parents 9199f34d838e
children d13f8ae3b1de
line wrap: on
line diff
--- a/src/testdir/test_usercommands.vim
+++ b/src/testdir/test_usercommands.vim
@@ -549,4 +549,25 @@ func Test_command_list()
   call assert_equal("\nNo user-defined commands found", execute('command'))
 endfunc
 
+" Test for a custom user completion returning the wrong value type
+func Test_usercmd_custom()
+  func T1(a, c, p)
+    return "a\nb\n"
+  endfunc
+  command -nargs=* -complete=customlist,T1 TCmd1
+  call feedkeys(":T1 \<C-A>\<C-B>\"\<CR>", 'xt')
+  call assert_equal('"T1 ', @:)
+  delcommand TCmd1
+  delfunc T1
+
+  func T2(a, c, p)
+    return ['a', 'b', 'c']
+  endfunc
+  command -nargs=* -complete=customlist,T2 TCmd2
+  call feedkeys(":T2 \<C-A>\<C-B>\"\<CR>", 'xt')
+  call assert_equal('"T2 ', @:)
+  delcommand TCmd2
+  delfunc T2
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab