mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
eval: Alter E5050 error message, test that
This commit is contained in:
parent
475cd8f075
commit
5e6f7e1d55
@ -10991,8 +10991,7 @@ void get_user_input(const typval_T *const argvars,
|
|||||||
char xp_name_buf[NUMBUFLEN];
|
char xp_name_buf[NUMBUFLEN];
|
||||||
if (argvars[0].v_type == VAR_DICT) {
|
if (argvars[0].v_type == VAR_DICT) {
|
||||||
if (argvars[1].v_type != VAR_UNKNOWN) {
|
if (argvars[1].v_type != VAR_UNKNOWN) {
|
||||||
emsgf(
|
emsgf(_("E5050: {opts} must be the only argument"));
|
||||||
_("E5050: When providing {opts} argument no more arguments follow"));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const dict_T *const dict = argvars[0].vval.v_dict;
|
const dict_T *const dict = argvars[0].vval.v_dict;
|
||||||
|
@ -175,6 +175,10 @@ describe('input()', function()
|
|||||||
exc_exec('call input({"default": []})'))
|
exc_exec('call input({"default": []})'))
|
||||||
eq('Vim(call):E730: using List as a String',
|
eq('Vim(call):E730: using List as a String',
|
||||||
exc_exec('call input({"completion": []})'))
|
exc_exec('call input({"completion": []})'))
|
||||||
|
eq('Vim(call):E5050: {opts} must be the only argument',
|
||||||
|
exc_exec('call input({}, "default")'))
|
||||||
|
eq('Vim(call):E118: Too many arguments for function: input',
|
||||||
|
exc_exec('call input("prompt> ", "default", "file", "extra")'))
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
describe('inputdialog()', function()
|
describe('inputdialog()', function()
|
||||||
@ -322,5 +326,9 @@ describe('inputdialog()', function()
|
|||||||
exc_exec('call inputdialog({"default": []})'))
|
exc_exec('call inputdialog({"default": []})'))
|
||||||
eq('Vim(call):E730: using List as a String',
|
eq('Vim(call):E730: using List as a String',
|
||||||
exc_exec('call inputdialog({"completion": []})'))
|
exc_exec('call inputdialog({"completion": []})'))
|
||||||
|
eq('Vim(call):E5050: {opts} must be the only argument',
|
||||||
|
exc_exec('call inputdialog({}, "default")'))
|
||||||
|
eq('Vim(call):E118: Too many arguments for function: inputdialog',
|
||||||
|
exc_exec('call inputdialog("prompt> ", "default", "file", "extra")'))
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user