diff options
author | ZyX <kp-pav@yandex.ru> | 2017-04-08 21:30:47 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-05-10 15:52:49 +0300 |
commit | 5e6f7e1d558fed8ef7b368a62b68d59af6766143 (patch) | |
tree | 9f3c39cb1aef723355a75ce2cfcc07efec712444 | |
parent | 475cd8f0750e16863ab049b3a192a9081ee7c986 (diff) | |
download | rneovim-5e6f7e1d558fed8ef7b368a62b68d59af6766143.tar.gz rneovim-5e6f7e1d558fed8ef7b368a62b68d59af6766143.tar.bz2 rneovim-5e6f7e1d558fed8ef7b368a62b68d59af6766143.zip |
eval: Alter E5050 error message, test that
-rw-r--r-- | src/nvim/eval.c | 3 | ||||
-rw-r--r-- | test/functional/eval/input_spec.lua | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 780a33eced..882b824b49 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10991,8 +10991,7 @@ void get_user_input(const typval_T *const argvars, char xp_name_buf[NUMBUFLEN]; if (argvars[0].v_type == VAR_DICT) { if (argvars[1].v_type != VAR_UNKNOWN) { - emsgf( - _("E5050: When providing {opts} argument no more arguments follow")); + emsgf(_("E5050: {opts} must be the only argument")); return; } const dict_T *const dict = argvars[0].vval.v_dict; diff --git a/test/functional/eval/input_spec.lua b/test/functional/eval/input_spec.lua index d655d9eb4a..51fd06dd90 100644 --- a/test/functional/eval/input_spec.lua +++ b/test/functional/eval/input_spec.lua @@ -175,6 +175,10 @@ describe('input()', function() exc_exec('call input({"default": []})')) eq('Vim(call):E730: using 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):E118: Too many arguments for function: input', + exc_exec('call input("prompt> ", "default", "file", "extra")')) end) end) describe('inputdialog()', function() @@ -322,5 +326,9 @@ describe('inputdialog()', function() exc_exec('call inputdialog({"default": []})')) eq('Vim(call):E730: using List as a String', 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) |