diff src/testdir/test_channel.vim @ 9367:2465b6cda394 v7.4.1965

commit https://github.com/vim/vim/commit/adb78a77ebb47627bcf73bd16ac1119d970e17c8 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 27 21:10:31 2016 +0200 patch 7.4.1965 Problem: When using a job in raw mode to append to a buffer garbage characters are added. Solution: Do not replace the trailing NUL with a NL. (Ozaki Kiichi)
author Christian Brabandt <cb@256bit.org>
date Mon, 27 Jun 2016 21:15:05 +0200
parents 78fc4c84476e
children 9f8f03a44886
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -1018,6 +1018,28 @@ func Test_pipe_null()
   call job_stop(job)
 endfunc
 
+func Test_pipe_to_buffer_raw()
+  if !has('job')
+    return
+  endif
+  call ch_log('Test_raw_pipe_to_buffer()')
+  let options = {'out_mode': 'raw', 'out_io': 'buffer', 'out_name': 'testout'}
+  split testout
+  let job = job_start([s:python, '-c', 
+        \ 'import sys; [sys.stdout.write(".") and sys.stdout.flush() for _ in range(10000)]'], options)
+  call assert_equal("run", job_status(job))
+  call s:waitFor('len(join(getline(2,line("$")),"") >= 10000')
+  try
+    for line in getline(2, '$')
+      let line = substitute(line, '^\.*', '', '')
+      call assert_equal('', line)
+    endfor
+  finally
+    call job_stop(job)
+    bwipe!
+  endtry
+endfunc
+
 func Test_reuse_channel()
   if !has('job')
     return