summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-26 19:01:05 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-26 19:01:05 +0200
commit437905c25d4cedfa16d0f87392e4a000d22362b7 (patch)
tree76d9b43fe93964d1510c7de864cebcf5c91a7fb4 /src/testdir
parentc7baa43fdb3f5b001ba3e6eb05bf6e199698eeea (diff)
downloadvim-437905c25d4cedfa16d0f87392e4a000d22362b7.zip
patch 7.4.1789
Problem: Cannot use ch_read() in the close callback. Solution: Do not discard the channel if there is readahead. Do not discard readahead if there is a close callback.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_channel.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index 0dba83d8e..6eb3c1f04 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1080,6 +1080,28 @@ func Test_out_close_cb()
endtry
endfunc
+func Test_read_in_close_cb()
+ if !has('job')
+ return
+ endif
+ call ch_log('Test_read_in_close_cb()')
+
+ let s:received = ''
+ func! CloseHandler(chan)
+ let s:received = ch_read(a:chan)
+ endfunc
+ let job = job_start(s:python . " test_channel_pipe.py quit now",
+ \ {'close_cb': 'CloseHandler'})
+ call assert_equal("run", job_status(job))
+ try
+ call s:waitFor('s:received != ""')
+ call assert_equal('quit', s:received)
+ finally
+ call job_stop(job)
+ delfunc CloseHandler
+ endtry
+endfunc
+
""""""""""
let s:unletResponse = ''