refactor(test): drop deprecated exc_exec #39242

This commit is contained in:
Justin M. Keyes
2026-04-20 14:16:41 -04:00
committed by GitHub
parent faa7c15b5a
commit 4ceca862fc
77 changed files with 1009 additions and 799 deletions

View File

@@ -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()