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/input_spec.lua | |
| parent | faa7c15b5a711435ed9d90f7fbf2a2ff8f1255c7 (diff) | |
refactor(test): drop deprecated exc_exec #39242
Diffstat (limited to 'test/functional/vimscript/input_spec.lua')
| -rw-r--r-- | test/functional/vimscript/input_spec.lua | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/test/functional/vimscript/input_spec.lua b/test/functional/vimscript/input_spec.lua index 1995b033b9..c0ab4adebb 100644 --- a/test/functional/vimscript/input_spec.lua +++ b/test/functional/vimscript/input_spec.lua @@ -3,12 +3,12 @@ local n = require('test.functional.testnvim')() local Screen = require('test.functional.ui.screen') local eq = t.eq +local pcall_err = t.pcall_err local feed = n.feed local api = n.api local clear = n.clear local source = n.source local command = n.command -local exc_exec = n.exc_exec local async_meths = n.async_meths local NIL = vim.NIL @@ -205,16 +205,25 @@ describe('input()', function() eq('DEF2', api.nvim_get_var('var')) end) it('errors out on invalid inputs', function() - eq('Vim(call):E730: Using a List as a String', exc_exec('call input([])')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call input("", [])')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call input("", "", [])')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call input({"prompt": []})')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call input({"default": []})')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call input({"completion": []})')) - eq('Vim(call):E5050: {opts} must be the only argument', exc_exec('call input({}, "default")')) + eq('Vim(call):E730: Using a List as a String', pcall_err(command, 'call input([])')) + eq('Vim(call):E730: Using a List as a String', pcall_err(command, 'call input("", [])')) + eq('Vim(call):E730: Using a List as a String', pcall_err(command, 'call input("", "", [])')) + eq('Vim(call):E730: Using a List as a String', pcall_err(command, 'call input({"prompt": []})')) + eq( + 'Vim(call):E730: Using a List as a String', + pcall_err(command, 'call input({"default": []})') + ) + eq( + 'Vim(call):E730: Using a List as a String', + pcall_err(command, 'call input({"completion": []})') + ) + eq( + 'Vim(call):E5050: {opts} must be the only argument', + pcall_err(command, 'call input({}, "default")') + ) eq( 'Vim(call):E118: Too many arguments for function: input', - exc_exec('call input("prompt> ", "default", "file", "extra")') + pcall_err(command, 'call input("prompt> ", "default", "file", "extra")') ) end) it('supports highlighting', function() @@ -378,19 +387,31 @@ describe('inputdialog()', function() eq('DEF2', api.nvim_get_var('var')) end) it('errors out on invalid inputs', function() - eq('Vim(call):E730: Using a List as a String', exc_exec('call inputdialog([])')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call inputdialog("", [])')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call inputdialog("", "", [])')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call inputdialog({"prompt": []})')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call inputdialog({"default": []})')) - eq('Vim(call):E730: Using a List as a String', exc_exec('call inputdialog({"completion": []})')) + eq('Vim(call):E730: Using a List as a String', pcall_err(command, 'call inputdialog([])')) + eq('Vim(call):E730: Using a List as a String', pcall_err(command, 'call inputdialog("", [])')) + eq( + 'Vim(call):E730: Using a List as a String', + pcall_err(command, 'call inputdialog("", "", [])') + ) + eq( + 'Vim(call):E730: Using a List as a String', + pcall_err(command, 'call inputdialog({"prompt": []})') + ) + eq( + 'Vim(call):E730: Using a List as a String', + pcall_err(command, 'call inputdialog({"default": []})') + ) + eq( + 'Vim(call):E730: Using a List as a String', + pcall_err(command, 'call inputdialog({"completion": []})') + ) eq( 'Vim(call):E5050: {opts} must be the only argument', - exc_exec('call inputdialog({}, "default")') + pcall_err(command, 'call inputdialog({}, "default")') ) eq( 'Vim(call):E118: Too many arguments for function: inputdialog', - exc_exec('call inputdialog("prompt> ", "default", "file", "extra")') + pcall_err(command, 'call inputdialog("prompt> ", "default", "file", "extra")') ) end) it('supports highlighting', function() |
