summaryrefslogtreecommitdiff
path: root/src/testdir/test_channel.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-30 16:07:23 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-30 16:07:23 +0200
commitd75263c020a5044fa73bc8cd57ce73ca5e23b360 (patch)
tree90c14b44f93abba7f154da456f03a5b991fa2a41 /src/testdir/test_channel.vim
parent8e3d1b6326c103cc92f8d07b1161ee5172acf201 (diff)
downloadvim-d75263c020a5044fa73bc8cd57ce73ca5e23b360.zip
patch 7.4.1807
Problem: Test_out_close_cb sometimes fails. Solution: Always write DETACH to out, not err.
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r--src/testdir/test_channel.vim16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 6eb3c1f04..702fa0cbb 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1055,10 +1055,15 @@ func Test_out_close_cb()
call ch_log('Test_out_close_cb()')
let s:counter = 1
- let s:outmsg = 0
+ let s:msg1 = ''
+ let s:msg2 = ''
let s:closemsg = 0
func! OutHandler(chan, msg)
- let s:outmsg = s:counter
+ if s:counter == 1
+ let s:msg1 = a:msg
+ else
+ let s:msg2 = a:msg
+ endif
let s:counter += 1
endfunc
func! CloseHandler(chan)
@@ -1070,9 +1075,10 @@ func Test_out_close_cb()
\ 'close_cb': 'CloseHandler'})
call assert_equal("run", job_status(job))
try
- call s:waitFor('s:closemsg != 0 && s:outmsg != 0')
- call assert_equal(1, s:outmsg)
- call assert_equal(2, s:closemsg)
+ call s:waitFor('s:closemsg != 0 && s:msg2 != ""')
+ call assert_equal('quit', s:msg1)
+ call assert_equal('DETACH', s:msg2)
+ call assert_equal(3, s:closemsg)
finally
call job_stop(job)
delfunc OutHandler