summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_channel.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-23 22:33:18 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-23 22:33:18 +0100
commitcfc15237ab88ecb78b12030f6e04b87618b56124 (patch)
treec00c9593abe5dccd1e36108c9a6e29d15669d28c /src/testdir/test_channel.vim
parentdd29ea18050284526174b5685781469240f5bc4a (diff)
patch 8.1.0799: calling deleted function; test doesn't work on Macv8.1.0799
Problem: Calling deleted function; test doesn't work on Mac. Solution: Wait for the function to be called before deleting it. Use a job to write to the pty, unless in the GUI. (Ozaki Kiichi, closes #3854)
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r--src/testdir/test_channel.vim7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index d3f36f88e4..15ca9ddbb5 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1945,10 +1945,11 @@ func Test_job_start_in_timer()
endif
func OutCb(chan, msg)
+ let g:val += 1
endfunc
func ExitCb(job, status)
- let g:val = 1
+ let g:val += 1
call Resume()
endfunc
@@ -1967,6 +1968,10 @@ func Test_job_start_in_timer()
call timer_start(1, 'TimerCb')
let elapsed = Standby(&ut)
call assert_inrange(1, &ut / 2, elapsed)
+
+ " Wait for both OutCb() and ExitCb() to have been called before deleting
+ " them.
+ call WaitForAssert({-> assert_equal(2, g:val)})
call job_stop(g:job)
delfunc OutCb