patch 8.2.0396: cmdexpand.c insufficiently tested
Problem: Cmdexpand.c insufficiently tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5789)
diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim
index a1d3995..f034508 100644
--- a/src/testdir/test_usercommands.vim
+++ b/src/testdir/test_usercommands.vim
@@ -262,7 +262,7 @@
endfunc
func CustomCompleteList(A, L, P)
- return [ "Monday", "Tuesday", "Wednesday" ]
+ return [ "Monday", "Tuesday", "Wednesday", {}]
endfunc
func Test_CmdCompletion()
@@ -327,6 +327,12 @@
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 @@
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