aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_cmdline.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_cmdline.vim')
-rw-r--r--src/nvim/testdir/test_cmdline.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_cmdline.vim b/src/nvim/testdir/test_cmdline.vim
index ffca415282..98340d0ac6 100644
--- a/src/nvim/testdir/test_cmdline.vim
+++ b/src/nvim/testdir/test_cmdline.vim
@@ -309,6 +309,11 @@ func Test_getcompletion()
let l = getcompletion('NoMatch', 'dir')
call assert_equal([], l)
+ if glob('~/*') !=# ''
+ let l = getcompletion('~/', 'dir')
+ call assert_true(l[0][0] ==# '~')
+ endif
+
let l = getcompletion('exe', 'expression')
call assert_true(index(l, 'executable(') >= 0)
let l = getcompletion('kill', 'expression')
@@ -422,6 +427,16 @@ func Test_getcompletion()
let l = getcompletion('call paint', 'cmdline')
call assert_equal([], l)
+ func T(a, c, p)
+ return "oneA\noneB\noneC"
+ endfunc
+ command -nargs=1 -complete=custom,T MyCmd
+ let l = getcompletion('MyCmd ', 'cmdline')
+ call assert_equal(['oneA', 'oneB', 'oneC'], l)
+
+ delcommand MyCmd
+ delfunc T
+
" For others test if the name is recognized.
let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user']
if has('cmdline_hist')