mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
Add error check
This commit is contained in:
parent
8e14d12635
commit
8e58fc0268
@ -4542,6 +4542,8 @@ f_getcompltype(typval_T *argvars, typval_T *rettv)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
pat = tv_get_string(&argvars[0]);
|
pat = tv_get_string(&argvars[0]);
|
||||||
|
if (check_for_string_arg(argvars, 0) == FAIL)
|
||||||
|
return;
|
||||||
|
|
||||||
ExpandInit(&xpc);
|
ExpandInit(&xpc);
|
||||||
|
|
||||||
|
@ -4591,6 +4591,7 @@ func Test_range_complete()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_getcompltype()
|
func Test_getcompltype()
|
||||||
|
call assert_fails('call getcompltype({})', 'E731:')
|
||||||
call assert_equal(getcompltype(''), 'command')
|
call assert_equal(getcompltype(''), 'command')
|
||||||
call assert_equal(getcompltype('dummy '), '')
|
call assert_equal(getcompltype('dummy '), '')
|
||||||
call assert_equal(getcompltype('cd '), 'dir_in_path')
|
call assert_equal(getcompltype('cd '), 'dir_in_path')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user