summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-10-03 21:37:41 +0200
committerBram Moolenaar <Bram@vim.org>2016-10-03 21:37:41 +0200
commitec68a99464055029c01082762517e97245ddae0c (patch)
tree36558e0f7c6a0bb29bb62f19aa3b0d73371e6305 /src/testdir
parent84dbd494dca599ecff05b2c2279d402c12e6d197 (diff)
downloadvim-git-ec68a99464055029c01082762517e97245ddae0c.tar.gz
patch 8.0.0022v8.0.0022
Problem: If a channel in NL mode is missing the NL at the end the remaining characters are dropped. Solution: When the channel is closed use the remaining text. (Ozaki Kiichi)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_channel.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index eb75a0b1d..0756dd51c 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1484,6 +1484,27 @@ func Test_raw_passes_nul()
bwipe!
endfunc
+func MyLineCountCb(ch, msg)
+ let g:linecount += 1
+endfunc
+
+func Test_read_nonl_line()
+ if !has('job')
+ return
+ endif
+
+ let g:linecount = 0
+ if has('win32')
+ " workaround: 'shellescape' does improper escaping double quotes
+ let arg = 'import sys;sys.stdout.write(\"1\n2\n3\")'
+ else
+ let arg = 'import sys;sys.stdout.write("1\n2\n3")'
+ endif
+ call job_start([s:python, '-c', arg], {'callback': 'MyLineCountCb'})
+ call WaitFor('3 <= g:linecount')
+ call assert_equal(3, g:linecount)
+endfunc
+
function Ch_test_close_lambda(port)
let handle = ch_open('localhost:' . a:port, s:chopt)
if ch_status(handle) == "fail"