diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-13 02:13:29 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-04-13 17:07:58 +0200 |
commit | 7e1591e06ab85bf088c7482a15ad48fc58c1005d (patch) | |
tree | 5a1e8c7f87d11bd28598836c7a989186bd3e0746 /test/functional/api/vim_spec.lua | |
parent | d08692a8246039b938b5645a6c01b4ff7f51671e (diff) | |
download | rneovim-7e1591e06ab85bf088c7482a15ad48fc58c1005d.tar.gz rneovim-7e1591e06ab85bf088c7482a15ad48fc58c1005d.tar.bz2 rneovim-7e1591e06ab85bf088c7482a15ad48fc58c1005d.zip |
API: emit nvim_error_event on failed async request
We already do this for _invalid_ async requests #9300.
Now we also do it for failed invocation of valid requests.
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r-- | test/functional/api/vim_spec.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 068d4973af..c508ca37db 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -49,13 +49,23 @@ describe('API', function() it('handles errors in async requests', function() local error_types = meths.get_api_info()[2].error_types - nvim_async("bogus") + nvim_async('bogus') eq({'notification', 'nvim_error_event', {error_types.Exception.id, 'Invalid method: nvim_bogus'}}, next_msg()) -- error didn't close channel. eq(2, eval('1+1')) end) + it('failed async request emits nvim_error_event', function() + local error_types = meths.get_api_info()[2].error_types + nvim_async('command', 'bogus') + eq({'notification', 'nvim_error_event', + {error_types.Exception.id, 'Vim:E492: Not an editor command: bogus'}}, + next_msg()) + -- error didn't close channel. + eq(2, eval('1+1')) + end) + it('does not set CA_COMMAND_BUSY #7254', function() nvim('command', 'split') nvim('command', 'autocmd WinEnter * startinsert') |