diff src/testdir/test_channel.vim @ 8436:0e6fd2f802b3 v7.4.1509

commit https://github.com/vim/vim/commit/151f656e171f6ffbb0cbeb343cbcf2ffac0c36b0 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Mar 7 21:19:38 2016 +0100 patch 7.4.1509 Problem: Keeping both a variable for a job and the channel it refers to is a hassle. Solution: Allow passing the job where a channel is expected. (Damien)
author Christian Brabandt <cb@256bit.org>
date Mon, 07 Mar 2016 21:30:14 +0100
parents 800423dbc260
children 541ca10b3bc7
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -463,16 +463,16 @@ func Test_raw_pipe()
   let job = job_start(s:python . " test_channel_pipe.py", {'mode': 'raw'})
   call assert_equal("run", job_status(job))
   try
-    let handle = job_getchannel(job)
-    call ch_sendraw(handle, "echo something\n")
-    let msg = ch_readraw(handle)
+    " For a change use the job where a channel is expected.
+    call ch_sendraw(job, "echo something\n")
+    let msg = ch_readraw(job)
     call assert_equal("something\n", substitute(msg, "\r", "", 'g'))
 
-    call ch_sendraw(handle, "double this\n")
-    let msg = ch_readraw(handle)
+    call ch_sendraw(job, "double this\n")
+    let msg = ch_readraw(job)
     call assert_equal("this\nAND this\n", substitute(msg, "\r", "", 'g'))
 
-    let reply = ch_evalraw(handle, "quit\n", {'timeout': 100})
+    let reply = ch_evalraw(job, "quit\n", {'timeout': 100})
     call assert_equal("Goodbye!\n", substitute(reply, "\r", "", 'g'))
   finally
     call job_stop(job)