diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-02-20 11:37:55 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-02-20 12:32:23 +0100 |
commit | 04fdbfe17d5c8242f54459472120177188949f82 (patch) | |
tree | 796687774910d29e8627d1b6142c7d370fa45610 /test/functional | |
parent | 09b51bbf87b16af9a186cea750ada748d89aa259 (diff) | |
download | rneovim-04fdbfe17d5c8242f54459472120177188949f82.tar.gz rneovim-04fdbfe17d5c8242f54459472120177188949f82.tar.bz2 rneovim-04fdbfe17d5c8242f54459472120177188949f82.zip |
jobwait: return -2 on interrupt also with timeout
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/core/job_spec.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index a02d36c939..65ec198a08 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -491,7 +491,7 @@ describe('jobs', function() eq({'notification', 'wait', {{-3, 5}}}, next_msg()) end) - it('will return -2 when interrupted', function() + it('will return -2 when interrupted without timeout', function() feed_command('call rpcnotify(g:channel, "ready") | '.. 'call rpcnotify(g:channel, "wait", '.. 'jobwait([jobstart("sleep 10; exit 55")]))') @@ -500,6 +500,15 @@ describe('jobs', function() eq({'notification', 'wait', {{-2}}}, next_msg()) end) + it('will return -2 when interrupted with timeout', function() + feed_command('call rpcnotify(g:channel, "ready") | '.. + 'call rpcnotify(g:channel, "wait", '.. + 'jobwait([jobstart("sleep 10; exit 55")], 10000))') + eq({'notification', 'ready', {}}, next_msg()) + feed('<c-c>') + eq({'notification', 'wait', {{-2}}}, next_msg()) + end) + it('can be called recursively', function() if helpers.pending_win32(pending) then return end -- TODO: Need `cat`. source([[ |