diff options
| author | Bram Moolenaar <Bram@vim.org> | 2016-10-15 18:36:49 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2016-10-15 18:36:49 +0200 |
| commit | 97792de2762cc79cc365a8a0b858f27753179577 (patch) | |
| tree | 6a9b69f2cabc6135b91c7dfaed7c69a9a7c0419f /src/testdir | |
| parent | 472e85970ee3a80abd824bef510df12e9cfe9e96 (diff) | |
| download | vim-git-97792de2762cc79cc365a8a0b858f27753179577.tar.gz | |
patch 8.0.0036v8.0.0036
Problem: Detecting that a job has finished may take a while.
Solution: Check for a finished job more often (Ozaki Kiichi)
Diffstat (limited to 'src/testdir')
| -rw-r--r-- | src/testdir/test_channel.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index fbcd496e9..e7ba66768 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -1362,6 +1362,24 @@ func Test_exit_callback() endif endfunc +let g:exit_cb_time = {'start': 0, 'end': 0} +function MyExitTimeCb(job, status) + let g:exit_cb_time.end = reltime(g:exit_cb_time.start) +endfunction + +func Test_exit_callback_interval() + if !has('job') + return + endif + + let g:exit_cb_time.start = reltime() + let job = job_start([s:python, '-c', 'import time;time.sleep(0.5)'], {'exit_cb': 'MyExitTimeCb'}) + call WaitFor('g:exit_cb_time.end != 0') + let elapsed = reltimefloat(g:exit_cb_time.end) + call assert_true(elapsed > 0.3) + call assert_true(elapsed < 1.0) +endfunc + """"""""" let g:Ch_close_ret = 'alive' |
