diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-10-09 17:28:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-10-09 17:28:01 +0200 |
commit | dc0ccaee68ca24d10050117fbec757ad33590a17 (patch) | |
tree | 8a98b130b1cd6b91b209c8163220da3f6c5ae440 /src/testdir/test_channel.vim | |
parent | 9b4579481892a62e7e002498b9eddaaf75bbda49 (diff) |
patch 8.0.0027v8.0.0027
Problem: A channel is closed when reading on stderr or stdout fails, but
there may still be something to read on another part.
Solution: Turn ch_to_be_closed into a bitfield. (Ozaki Kiichi)
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r-- | src/testdir/test_channel.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 0756dd51c5..fbcd496e99 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -1505,6 +1505,23 @@ func Test_read_nonl_line() call assert_equal(3, g:linecount) endfunc +func Test_read_from_terminated_job() + if !has('job') + return + endif + + let g:linecount = 0 + if has('win32') + " workaround: 'shellescape' does improper escaping double quotes + let arg = 'import os,sys;os.close(1);sys.stderr.write(\"test\n\")' + else + let arg = 'import os,sys;os.close(1);sys.stderr.write("test\n")' + endif + call job_start([s:python, '-c', arg], {'callback': 'MyLineCountCb'}) + call WaitFor('1 <= g:linecount') + call assert_equal(1, g:linecount) +endfunc + function Ch_test_close_lambda(port) let handle = ch_open('localhost:' . a:port, s:chopt) if ch_status(handle) == "fail" |