diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/vimscript/ctx_functions_spec.lua | 7 | ||||
-rw-r--r-- | test/old/testdir/test_functions.vim | 4 | ||||
-rw-r--r-- | test/old/testdir/test_user_func.vim | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/test/functional/vimscript/ctx_functions_spec.lua b/test/functional/vimscript/ctx_functions_spec.lua index 873e4f820d..85a74c0ab6 100644 --- a/test/functional/vimscript/ctx_functions_spec.lua +++ b/test/functional/vimscript/ctx_functions_spec.lua @@ -188,7 +188,10 @@ describe('context functions', function() function RestoreFuncs() call ctxpop() endfunction + + let g:sid = expand('<SID>') ]]) + local sid = api.nvim_get_var('sid') eq('Hello, World!', exec_capture([[call Greet('World')]])) eq( @@ -200,11 +203,11 @@ describe('context functions', function() call('DeleteSFuncs') eq( - 'function Greet, line 1: Vim(call):E117: Unknown function: s:greet', + ('function Greet, line 1: Vim(call):E117: Unknown function: %sgreet'):format(sid), pcall_err(command, [[call Greet('World')]]) ) eq( - 'function GreetAll, line 1: Vim(call):E117: Unknown function: s:greet_all', + ('function GreetAll, line 1: Vim(call):E117: Unknown function: %sgreet_all'):format(sid), pcall_err(command, [[call GreetAll('World', 'One', 'Two', 'Three')]]) ) diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index 327ea98e1c..01e6001dcc 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -2672,7 +2672,9 @@ endfunc func Test_call() call assert_equal(3, call('len', [123])) call assert_equal(3, 'len'->call([123])) - call assert_fails("call call('len', 123)", 'E714:') + call assert_equal(4, call({ x -> len(x) }, ['xxxx'])) + call assert_equal(2, call(function('len'), ['xx'])) + call assert_fails("call call('len', 123)", 'E1211:') call assert_equal(0, call('', [])) call assert_equal(0, call('len', v:_null_list)) diff --git a/test/old/testdir/test_user_func.vim b/test/old/testdir/test_user_func.vim index 3c24412eb7..b509b03778 100644 --- a/test/old/testdir/test_user_func.vim +++ b/test/old/testdir/test_user_func.vim @@ -380,7 +380,7 @@ func Test_script_local_func() " Try to call a script local function in global scope let lines =<< trim [CODE] :call assert_fails('call s:Xfunc()', 'E81:') - :call assert_fails('let x = call("<SID>Xfunc", [])', 'E120:') + :call assert_fails('let x = call("<SID>Xfunc", [])', ['E81:', 'E117:']) :call writefile(v:errors, 'Xresult') :qall |