aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-02-20 15:15:06 +0100
committerGitHub <noreply@github.com>2018-02-20 15:15:06 +0100
commitc57d31596370e12a3e2019468ea6cefecf69449e (patch)
tree3853b97e7c199fb7565022f4e66c57fd6592835d /test
parent6bbec71fdebd2b125350675d8683a0adf244c3c3 (diff)
parent04fdbfe17d5c8242f54459472120177188949f82 (diff)
downloadrneovim-c57d31596370e12a3e2019468ea6cefecf69449e.tar.gz
rneovim-c57d31596370e12a3e2019468ea6cefecf69449e.tar.bz2
rneovim-c57d31596370e12a3e2019468ea6cefecf69449e.zip
Merge pull request #8031 from bfredl/gotintstatus
jobwait: return -2 on interrupt even with timeout
Diffstat (limited to 'test')
-rw-r--r--test/functional/core/job_spec.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua
index 50feb41d1a..e3c93d4b5a 100644
--- a/test/functional/core/job_spec.lua
+++ b/test/functional/core/job_spec.lua
@@ -497,7 +497,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")]))')
@@ -506,6 +506,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([[