patch 9.0.0437: no error when custom completion function returns wrong type
Problem: No error when a custom completion function returns something else
than the expected list.
Solution: Give an error. (closes #11100)
diff --git a/src/testdir/test_usercommands.vim b/src/testdir/test_usercommands.vim
index 91d8bfd..8a41004 100644
--- a/src/testdir/test_usercommands.vim
+++ b/src/testdir/test_usercommands.vim
@@ -666,7 +666,7 @@
return "a\nb\n"
endfunc
command -nargs=* -complete=customlist,T1 TCmd1
- call feedkeys(":TCmd1 \<C-A>\<C-B>\"\<CR>", 'xt')
+ call assert_fails('call feedkeys(":TCmd1 \<C-A>\<C-B>\"\<CR>", "xt")', 'E1303: Custom list completion function does not return a List but a string')
call assert_equal('"TCmd1 ', @:)
delcommand TCmd1
delfunc T1
@@ -675,7 +675,7 @@
return {}
endfunc
command -nargs=* -complete=customlist,T2 TCmd2
- call feedkeys(":TCmd2 \<C-A>\<C-B>\"\<CR>", 'xt')
+ call assert_fails('call feedkeys(":TCmd2 \<C-A>\<C-B>\"\<CR>", "xt")', 'E1303: Custom list completion function does not return a List but a dict')
call assert_equal('"TCmd2 ', @:)
delcommand TCmd2
delfunc T2