mirror of
https://github.com/neovim/neovim.git
synced 2026-05-24 05:40:08 +00:00
refactor(test): drop deprecated exc_exec #39242
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user