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/execute_spec.lua | |
| parent | faa7c15b5a711435ed9d90f7fbf2a2ff8f1255c7 (diff) | |
refactor(test): drop deprecated exc_exec #39242
Diffstat (limited to 'test/functional/vimscript/execute_spec.lua')
| -rw-r--r-- | test/functional/vimscript/execute_spec.lua | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/test/functional/vimscript/execute_spec.lua b/test/functional/vimscript/execute_spec.lua index 457f7d184e..f57f6307ea 100644 --- a/test/functional/vimscript/execute_spec.lua +++ b/test/functional/vimscript/execute_spec.lua @@ -6,7 +6,6 @@ local eq = t.eq local eval = n.eval local clear = n.clear local source = n.source -local exc_exec = n.exc_exec local pcall_err = t.pcall_err local fn = n.fn local command = n.command @@ -89,19 +88,19 @@ describe('execute()', function() it('returns empty string if the argument list is empty', function() eq('', fn.execute({})) - eq(0, exc_exec('let g:ret = execute(v:_null_list)')) + command('let g:ret = execute(v:_null_list)') eq('', eval('g:ret')) end) it('captures errors', function() local ret - ret = exc_exec('call execute(v:_null_dict)') + ret = pcall_err(command, 'call execute(v:_null_dict)') eq('Vim(call):E731: Using a Dictionary as a String', ret) - ret = exc_exec('call execute(function("tr"))') + ret = pcall_err(command, 'call execute(function("tr"))') eq('Vim(call):E729: Using a Funcref as a String', ret) - ret = exc_exec('call execute(["echo 42", v:_null_dict, "echo 44"])') + ret = pcall_err(command, 'call execute(["echo 42", v:_null_dict, "echo 44"])') eq('Vim:E731: Using a Dictionary as a String', ret) - ret = exc_exec('call execute(["echo 42", function("tr"), "echo 44"])') + ret = pcall_err(command, 'call execute(["echo 42", function("tr"), "echo 44"])') eq('Vim:E729: Using a Funcref as a String', ret) end) @@ -305,31 +304,31 @@ describe('execute()', function() end) it('suppresses errors for "silent!"', function() - eq(0, exc_exec('let g:mes = execute(0.0, "silent!")')) + command('let g:mes = execute(0.0, "silent!")') eq('', eval('g:mes')) - eq(0, exc_exec('let g:mes = execute("echon add(1, 1)", "silent!")')) + command('let g:mes = execute("echon add(1, 1)", "silent!")') eq('1', eval('g:mes')) - eq(0, exc_exec('let g:mes = execute(["echon 42", "echon add(1, 1)"], "silent!")')) + command('let g:mes = execute(["echon 42", "echon add(1, 1)"], "silent!")') eq('421', eval('g:mes')) end) it('propagates errors for "" and "silent"', function() local ret - ret = exc_exec('call execute(v:_null_dict, "silent")') + ret = pcall_err(command, 'call execute(v:_null_dict, "silent")') eq('Vim(call):E731: Using a Dictionary as a String', ret) - ret = exc_exec('call execute("echo add(1, 1)", "")') + ret = pcall_err(command, 'call execute("echo add(1, 1)", "")') eq('Vim(echo):E897: List or Blob required', ret) - ret = exc_exec('call execute(["echon 42", "echo add(1, 1)"], "")') + ret = pcall_err(command, 'call execute(["echon 42", "echo add(1, 1)"], "")') eq('Vim(echo):E897: List or Blob required', ret) - ret = exc_exec('call execute("echo add(1, 1)", "silent")') + ret = pcall_err(command, 'call execute("echo add(1, 1)", "silent")') eq('Vim(echo):E897: List or Blob required', ret) - ret = exc_exec('call execute(["echon 42", "echo add(1, 1)"], "silent")') + ret = pcall_err(command, 'call execute(["echon 42", "echo add(1, 1)"], "silent")') eq('Vim(echo):E897: List or Blob required', ret) end) end) |
