From 240583869ae477202494dd01ef1e8e2bac650f10 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 24 Jan 2019 23:11:49 +0100 Subject: patch 8.1.0818: MS-Windows: cannot send large data with ch_sendraw() Problem: MS-Windows: cannot send large data with ch_sendraw(). Solution: Split write into several WriteFile() calls. (Yasuhiro Matsumoto, closes #3823) --- src/testdir/test_channel.vim | 18 ++++++++++++++++++ src/testdir/test_channel_pipe.py | 4 ++++ 2 files changed, 22 insertions(+) (limited to 'src/testdir') diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 15ca9ddbb5..e7fcf95826 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -1980,3 +1980,21 @@ func Test_job_start_in_timer() unlet! g:val unlet! g:job endfunc + +func Test_raw_large_data() + try + let g:out = '' + let job = job_start(s:python . " test_channel_pipe.py", + \ {'mode': 'raw', 'drop': 'never', 'noblock': 1, + \ 'callback': {ch, msg -> execute('let g:out .= msg')}}) + + let want = repeat('X', 79999) . "\n" + call ch_sendraw(job, want) + let g:Ch_job = job + call WaitForAssert({-> assert_equal("dead", job_status(g:Ch_job))}) + call assert_equal(want, substitute(g:out, '\r', '', 'g')) + finally + call job_stop(job) + unlet g:out + endtry +endfunc diff --git a/src/testdir/test_channel_pipe.py b/src/testdir/test_channel_pipe.py index 940378624b..810a8e3032 100644 --- a/src/testdir/test_channel_pipe.py +++ b/src/testdir/test_channel_pipe.py @@ -56,4 +56,8 @@ if __name__ == "__main__": if typed.startswith("doubleerr "): print(typed[10:-1] + "\nAND " + typed[10:-1], file=sys.stderr) sys.stderr.flush() + if typed.startswith("XXX"): + print(typed, end='') + sys.stderr.flush() + break -- cgit v1.2.3