summaryrefslogtreecommitdiff
path: root/src/testdir/test_channel.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-12 15:51:44 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-12 15:51:44 +0100
commit5a6ec52392b78d41153660d0353d5b86a2dc583c (patch)
tree9fb7d04b1a75124f992a37f899c40a8ee5469c6d /src/testdir/test_channel.vim
parent1adda3403d80e96446248a92ceafee036053765c (diff)
downloadvim-5a6ec52392b78d41153660d0353d5b86a2dc583c.zip
patch 7.4.1543
Problem: Channel log methods are not tested. Solution: Log job activity and check it.
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r--src/testdir/test_channel.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index c9658802d..c50c1df42 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -517,6 +517,7 @@ func Test_nl_err_to_out_pipe()
if !has('job')
return
endif
+ call ch_logfile('Xlog')
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))
@@ -529,6 +530,32 @@ func Test_nl_err_to_out_pipe()
call assert_equal("wrong", ch_readraw(handle))
finally
call job_stop(job)
+ call ch_logfile('')
+ let loglines = readfile('Xlog')
+ call assert_true(len(loglines) > 10)
+ let found_test = 0
+ let found_send = 0
+ let found_recv = 0
+ let found_stop = 0
+ for l in loglines
+ if l =~ 'Test_nl_err_to_out_pipe'
+ let found_test = 1
+ endif
+ if l =~ 'SEND on.*echo something'
+ let found_send = 1
+ endif
+ if l =~ 'RECV on.*something'
+ let found_recv = 1
+ endif
+ if l =~ 'Stopping job with'
+ let found_stop = 1
+ endif
+ endfor
+ call assert_equal(1, found_test)
+ call assert_equal(1, found_send)
+ call assert_equal(1, found_recv)
+ call assert_equal(1, found_stop)
+ call delete('Xlog')
endtry
endfunc