diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-04-13 19:53:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-13 19:53:09 +0200 |
commit | 82d48c0dab0fe595edd6331e0b6ba9630f86b34a (patch) | |
tree | 51a80521ae9bfe4f98c47934133967e456b12aef /test/functional/api/vim_spec.lua | |
parent | cfe7f896b8e7a9188f79a4633f21e9ac4af57702 (diff) | |
parent | 7e1591e06ab85bf088c7482a15ad48fc58c1005d (diff) | |
download | rneovim-82d48c0dab0fe595edd6331e0b6ba9630f86b34a.tar.gz rneovim-82d48c0dab0fe595edd6331e0b6ba9630f86b34a.tar.bz2 rneovim-82d48c0dab0fe595edd6331e0b6ba9630f86b34a.zip |
Merge pull request #9896 from justinmk/api-async-error
API: emit nvim_error_event on failed async request
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') |