diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-05-06 10:30:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 10:30:48 +0200 |
commit | e3edcd06e3486a8bb50a7d9a231c3a473ac1a4d9 (patch) | |
tree | d4b9016cdc836c8ced64027e049927c34b9b768b /test/functional/api/vim_spec.lua | |
parent | 55187de1157e05ea71c7c0404345dee0e27e963e (diff) | |
parent | 511f06a56e77f612f7bc8ca563ebecb7239a9914 (diff) | |
download | rneovim-e3edcd06e3486a8bb50a7d9a231c3a473ac1a4d9.tar.gz rneovim-e3edcd06e3486a8bb50a7d9a231c3a473ac1a4d9.tar.bz2 rneovim-e3edcd06e3486a8bb50a7d9a231c3a473ac1a4d9.zip |
Merge pull request #18438 from famiu/feat/api/nvim_parse_cmd
fix(api): make `nvim_parse_cmd` propagate errors
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 610036f484..11c1fc6c2c 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -3426,10 +3426,15 @@ describe('API', function() }, meths.parse_cmd('MyCommand test it', {})) end) it('errors for invalid command', function() - eq('Error while parsing command line', pcall_err(meths.parse_cmd, 'Fubar', {})) + eq('Error while parsing command line', pcall_err(meths.parse_cmd, '', {})) + eq('Error while parsing command line', pcall_err(meths.parse_cmd, '" foo', {})) + eq('Error while parsing command line: E492: Not an editor command: Fubar', + pcall_err(meths.parse_cmd, 'Fubar', {})) command('command! Fubar echo foo') - eq('Error while parsing command line', pcall_err(meths.parse_cmd, 'Fubar!', {})) - eq('Error while parsing command line', pcall_err(meths.parse_cmd, '4,6Fubar', {})) + eq('Error while parsing command line: E477: No ! allowed', + pcall_err(meths.parse_cmd, 'Fubar!', {})) + eq('Error while parsing command line: E481: No range allowed', + pcall_err(meths.parse_cmd, '4,6Fubar', {})) end) end) end) |