diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-05 06:32:17 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-05-05 10:43:28 +0800 |
commit | 4a098b97e53551a3383e669f4730be542c61e012 (patch) | |
tree | 72fe784d342c52d3440070fa171457864b619ec8 /test/functional/ex_cmds/excmd_spec.lua | |
parent | 9ded4c127599b821d0875db9d63049b5970437a4 (diff) | |
download | rneovim-4a098b97e53551a3383e669f4730be542c61e012.tar.gz rneovim-4a098b97e53551a3383e669f4730be542c61e012.tar.bz2 rneovim-4a098b97e53551a3383e669f4730be542c61e012.zip |
fix(excmd): append original command to error message
Revert the change to do_cmdline_cmd() from #5226.
This function is used in many places, so making it different from Vim
leads to small differences from Vim in the behavior of some functions
like execute() and assert_fails(). If DOCMD_VERBOSE really needs to be
removed somewhere, a do_cmdline() call without DOCMD_VERBOSE is also
shorter than a do_cmdline() call with DOCMD_VERBOSE.
Diffstat (limited to 'test/functional/ex_cmds/excmd_spec.lua')
-rw-r--r-- | test/functional/ex_cmds/excmd_spec.lua | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/functional/ex_cmds/excmd_spec.lua b/test/functional/ex_cmds/excmd_spec.lua index 14cc2b8387..a92329ede5 100644 --- a/test/functional/ex_cmds/excmd_spec.lua +++ b/test/functional/ex_cmds/excmd_spec.lua @@ -11,20 +11,24 @@ describe('Ex cmds', function() clear() end) + local function check_excmd_err(cmd, err) + eq(err .. ': ' .. cmd, pcall_err(command, cmd)) + end + it('handle integer overflow from user-input #5555', function() command(':9999999999999999999999999999999999999999') command(':later 9999999999999999999999999999999999999999') command(':echo expand("#<9999999999999999999999999999999999999999")') command(':lockvar 9999999999999999999999999999999999999999') command(':winsize 9999999999999999999999999999999999999999 9999999999999999999999999999999999999999') - eq('Vim(tabnext):E475: Invalid argument: 9999999999999999999999999999999999999999', - pcall_err(command, ':tabnext 9999999999999999999999999999999999999999')) - eq('Vim(Next):E939: Positive count required', - pcall_err(command, ':N 9999999999999999999999999999999999999999')) + check_excmd_err(':tabnext 9999999999999999999999999999999999999999', + 'Vim(tabnext):E475: Invalid argument: 9999999999999999999999999999999999999999') + check_excmd_err(':N 9999999999999999999999999999999999999999', + 'Vim(Next):E939: Positive count required') + check_excmd_err(':bdelete 9999999999999999999999999999999999999999', + 'Vim(bdelete):E939: Positive count required') eq('Vim(menu):E329: No menu "9999999999999999999999999999999999999999"', pcall_err(command, ':menu 9999999999999999999999999999999999999999')) - eq('Vim(bdelete):E939: Positive count required', - pcall_err(command, ':bdelete 9999999999999999999999999999999999999999')) assert_alive() end) |