diff src/testdir/test_channel.vim @ 10233:d709622a18c9 v8.0.0015

commit https://github.com/vim/vim/commit/7ef3810d28b7ab2edbfcafab3fe8ad8bc2c2f138 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Sep 26 22:36:58 2016 +0200 patch 8.0.0015 Problem: Can't tell which part of a channel has "buffered" status. Solution: Add an optional argument to ch_status(). Let ch_info() also return "buffered" for out_status and err_status.
author Christian Brabandt <cb@256bit.org>
date Mon, 26 Sep 2016 22:45:05 +0200
parents 65afd399ffa7
children 920c73a27dda
line wrap: on
line diff
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -434,6 +434,23 @@ func Test_raw_pipe()
   let job = job_start(s:python . " test_channel_pipe.py", {'mode': 'raw'})
   call assert_equal(v:t_job, type(job))
   call assert_equal("run", job_status(job))
+
+  call assert_equal("open", ch_status(job))
+  call assert_equal("open", ch_status(job), {"part": "out"})
+  call assert_equal("open", ch_status(job), {"part": "err"})
+  call assert_fails('call ch_status(job, {"in_mode": "raw"})', 'E475:')
+  call assert_fails('call ch_status(job, {"part": "in"})', 'E475:')
+
+  let dict = ch_info(job)
+  call assert_true(dict.id != 0)
+  call assert_equal('open', dict.status)
+  call assert_equal('open', dict.out_status)
+  call assert_equal('RAW', dict.out_mode)
+  call assert_equal('pipe', dict.out_io)
+  call assert_equal('open', dict.err_status)
+  call assert_equal('RAW', dict.err_mode)
+  call assert_equal('pipe', dict.err_io)
+
   try
     " For a change use the job where a channel is expected.
     call ch_sendraw(job, "echo something\n")