diff src/testdir/test_channel.vim @ 15621:bfbdef46aa7d v8.1.0818

patch 8.1.0818: MS-Windows: cannot send large data with ch_sendraw() commit https://github.com/vim/vim/commit/240583869ae477202494dd01ef1e8e2bac650f10 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 24 23:11:49 2019 +0100 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)
author Bram Moolenaar <Bram@vim.org>
date Thu, 24 Jan 2019 23:15:05 +0100
parents 3137345451a4
children 858bf9c80c93
line wrap: on
line diff
--- 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