diff src/testdir/test_usercommands.vim @ 19679:9199f34d838e v8.2.0396

patch 8.2.0396: cmdexpand.c insufficiently tested Commit: https://github.com/vim/vim/commit/24ebd83e030e1c6f9a6be1f06232756ba4d00a8c Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 16 21:25:24 2020 +0100 patch 8.2.0396: cmdexpand.c insufficiently tested Problem: Cmdexpand.c insufficiently tested. Solution: Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5789)
author Bram Moolenaar <Bram@vim.org>
date Mon, 16 Mar 2020 21:30:04 +0100
parents 854fb0ad4be6
children b3e93a05c3ca
line wrap: on
line diff
--- a/src/testdir/test_usercommands.vim
+++ b/src/testdir/test_usercommands.vim
@@ -262,7 +262,7 @@ func CustomComplete(A, L, P)
 endfunc
 
 func CustomCompleteList(A, L, P)
-  return [ "Monday", "Tuesday", "Wednesday" ]
+  return [ "Monday", "Tuesday", "Wednesday", {}]
 endfunc
 
 func Test_CmdCompletion()
@@ -327,6 +327,12 @@ func Test_CmdCompletion()
 
   com! -complete=customlist,CustomComp DoCmd :
   call assert_fails("call feedkeys(':DoCmd \<C-D>', 'tx')", 'E117:')
+
+  " custom completion without a function
+  com! -complete=custom, DoCmd
+  call assert_beeps("call feedkeys(':DoCmd \t', 'tx')")
+
+  delcom DoCmd
 endfunc
 
 func CallExecute(A, L, P)
@@ -542,3 +548,5 @@ func Test_command_list()
   call assert_equal("\nNo user-defined commands found", execute(':command Xxx'))
   call assert_equal("\nNo user-defined commands found", execute('command'))
 endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab