diff src/testdir/test_channel.vim @ 8386:3b9a306724ec v7.4.1485

commit https://github.com/vim/vim/commit/014069a7ac51557e531eb3c8b94e36f2193f6c21 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 3 22:51:40 2016 +0100 patch 7.4.1485 Problem: Job input from buffer is not implemented. Solution: Implement it. Add "in-top" and "in-bot" options.
author Christian Brabandt <cb@256bit.org>
date Thu, 03 Mar 2016 23:00:05 +0100
parents 764dba33605c
children 8894d595b786
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -479,6 +479,31 @@ func Test_pipe_to_buffer()
   endtry
 endfunc
 
+func Test_pipe_from_buffer()
+  if !has('job')
+    return
+  endif
+call ch_logfile('channellog', 'w')
+  call ch_log('Test_pipe_from_buffer()')
+
+  sp pipe-input
+  call setline(1, ['echo one', 'echo two', 'echo three'])
+
+  let job = job_start(s:python . " test_channel_pipe.py",
+	\ {'in-io': 'buffer', 'in-name': 'pipe-input'})
+  call assert_equal("run", job_status(job))
+  try
+    let handle = job_getchannel(job)
+    call assert_equal('one', ch_read(handle))
+    call assert_equal('two', ch_read(handle))
+    call assert_equal('three', ch_read(handle))
+    bwipe!
+  finally
+    call job_stop(job)
+  endtry
+call ch_logfile('')
+endfunc
+
 func Test_pipe_to_nameless_buffer()
   if !has('job')
     return