diff src/testdir/test_channel.vim @ 8384:764dba33605c v7.4.1484

commit https://github.com/vim/vim/commit/c25558bff4ed10d2642e6f5c016701641c494916 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 3 21:02:23 2016 +0100 patch 7.4.1484 Problem: Channel "err-io" value "out" is not supported. Solution: Connect stderr to stdout if wanted.
author Christian Brabandt <cb@256bit.org>
date Thu, 03 Mar 2016 21:15:05 +0100
parents 3dbe93a240d8
children 3b9a306724ec
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -339,10 +339,8 @@ func s:raw_one_time_callback(port)
 endfunc
 
 func Test_raw_one_time_callback()
-  call ch_logfile('channellog', 'w')
   call ch_log('Test_raw_one_time_callback()')
   call s:run_server('s:raw_one_time_callback')
-  call ch_logfile('')
 endfunc
 
 """""""""
@@ -420,6 +418,9 @@ func Test_nl_pipe()
     call ch_sendraw(handle, "echo something\n")
     call assert_equal("something", ch_readraw(handle))
 
+    call ch_sendraw(handle, "echoerr wrong\n")
+    call assert_equal("wrong", ch_readraw(handle, {'part': 'err'}))
+
     call ch_sendraw(handle, "double this\n")
     call assert_equal("this", ch_readraw(handle))
     call assert_equal("AND this", ch_readraw(handle))
@@ -431,6 +432,25 @@ func Test_nl_pipe()
   endtry
 endfunc
 
+func Test_nl_err_to_out_pipe()
+  if !has('job')
+    return
+  endif
+  call ch_log('Test_nl_err_to_out_pipe()')
+  let job = job_start(s:python . " test_channel_pipe.py", {'err-io': 'out'})
+  call assert_equal("run", job_status(job))
+  try
+    let handle = job_getchannel(job)
+    call ch_sendraw(handle, "echo something\n")
+    call assert_equal("something", ch_readraw(handle))
+
+    call ch_sendraw(handle, "echoerr wrong\n")
+    call assert_equal("wrong", ch_readraw(handle))
+  finally
+    call job_stop(job)
+  endtry
+endfunc
+
 func Test_pipe_to_buffer()
   if !has('job')
     return