diff src/testdir/test_channel.vim @ 8031:ece323e2b57f v7.4.1310

commit https://github.com/vim/vim/commit/6463ca229cb9412581419497924c85fcbfc854ab Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 13 17:04:46 2016 +0100 patch 7.4.1310 Problem: Jobs don't open a channel. Solution: Create pipes and add them to the channel. Add ch_logfile(). Only Unix for now.
author Christian Brabandt <cb@256bit.org>
date Sat, 13 Feb 2016 17:15:05 +0100
parents 4fd171e5cedc
children 9dea1571b352
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -273,3 +273,20 @@ func Test_connect_waittime()
     call assert_true(reltimefloat(elapsed) < (has('unix') ? 1.0 : 3.0))
   endif
 endfunc
+
+func Test_pipe()
+  if !has('job') || !has('unix')
+    return
+  endif
+  let job = job_start("python test_channel_pipe.py")
+  call assert_equal("run", job_status(job))
+  try
+    let handle = job_getchannel(job)
+    call ch_sendraw(handle, "echo something\n", 0)
+    call assert_equal("something\n", ch_readraw(handle))
+    let reply = ch_sendraw(handle, "quit\n")
+    call assert_equal("Goodbye!\n", reply)
+  finally
+    call job_stop(job)
+  endtry
+endfunc