diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-04-20 14:16:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-20 14:16:41 -0400 |
| commit | 4ceca862fceb021049144a9aed05c60ae39b7aba (patch) | |
| tree | b7b1f1e421aeeaa2d30a348745c17f9f9b69b8d7 /test/functional/vimscript/eval_spec.lua | |
| parent | faa7c15b5a711435ed9d90f7fbf2a2ff8f1255c7 (diff) | |
refactor(test): drop deprecated exc_exec #39242
Diffstat (limited to 'test/functional/vimscript/eval_spec.lua')
| -rw-r--r-- | test/functional/vimscript/eval_spec.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/functional/vimscript/eval_spec.lua b/test/functional/vimscript/eval_spec.lua index b4e924104c..eeebdd9aa0 100644 --- a/test/functional/vimscript/eval_spec.lua +++ b/test/functional/vimscript/eval_spec.lua @@ -14,10 +14,10 @@ local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') local mkdir = t.mkdir +local pcall_err = t.pcall_err local clear = n.clear local eq = t.eq local exec = n.exec -local exc_exec = n.exc_exec local exec_lua = n.exec_lua local exec_capture = n.exec_capture local eval = n.eval @@ -42,7 +42,8 @@ describe('Up to MAX_FUNC_ARGS arguments are handled by', function() local rep = n.fn['repeat'] local expected = '2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,' eq(expected, printf(rep('%d,', max_func_args - 1), unpack(range(2, max_func_args)))) - local ret = exc_exec('call printf("", 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)') + local ret = + pcall_err(command, 'call printf("", 2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)') eq('Vim(call):E740: Too many arguments for function printf', ret) end) @@ -50,7 +51,10 @@ describe('Up to MAX_FUNC_ARGS arguments are handled by', function() local rpcnotify = n.fn.rpcnotify local ret = rpcnotify(0, 'foo', unpack(range(3, max_func_args))) eq(1, ret) - ret = exc_exec('call rpcnotify(0, "foo", 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)') + ret = pcall_err( + command, + 'call rpcnotify(0, "foo", 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21)' + ) eq('Vim(call):E740: Too many arguments for function rpcnotify', ret) end) end) @@ -158,7 +162,7 @@ describe('uncaught exception', function() it('is not forgotten #13490', function() command('autocmd BufWinEnter * throw "i am error"') - eq('i am error', exc_exec('try | new | endtry')) + t.matches('i am error', pcall_err(command, 'try | new | endtry')) -- Like Vim, throwing here aborts the processing of the script, but does not stop :runtime! -- from processing the others. @@ -180,7 +184,7 @@ describe('uncaught exception', function() end) command('set runtimepath+=. | let result = ""') - eq('throw1', exc_exec('try | runtime! throw*.vim | endtry')) + t.matches('throw1', pcall_err(command, 'try | runtime! throw*.vim | endtry')) eq('123', eval('result')) end) |
