Skip to content

Commit 5a6ec52

Browse files
committed
patch 7.4.1543
Problem: Channel log methods are not tested. Solution: Log job activity and check it.
1 parent 1adda34 commit 5a6ec52

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

src/testdir/test_channel.vim

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ func Test_nl_err_to_out_pipe()
517517
if !has('job')
518518
return
519519
endif
520+
call ch_logfile('Xlog')
520521
call ch_log('Test_nl_err_to_out_pipe()')
521522
let job = job_start(s:python . " test_channel_pipe.py", {'err-io': 'out'})
522523
call assert_equal("run", job_status(job))
@@ -529,6 +530,32 @@ func Test_nl_err_to_out_pipe()
529530
call assert_equal("wrong", ch_readraw(handle))
530531
finally
531532
call job_stop(job)
533+
call ch_logfile('')
534+
let loglines = readfile('Xlog')
535+
call assert_true(len(loglines) > 10)
536+
let found_test = 0
537+
let found_send = 0
538+
let found_recv = 0
539+
let found_stop = 0
540+
for l in loglines
541+
if l =~ 'Test_nl_err_to_out_pipe'
542+
let found_test = 1
543+
endif
544+
if l =~ 'SEND on.*echo something'
545+
let found_send = 1
546+
endif
547+
if l =~ 'RECV on.*something'
548+
let found_recv = 1
549+
endif
550+
if l =~ 'Stopping job with'
551+
let found_stop = 1
552+
endif
553+
endfor
554+
call assert_equal(1, found_test)
555+
call assert_equal(1, found_send)
556+
call assert_equal(1, found_recv)
557+
call assert_equal(1, found_stop)
558+
call delete('Xlog')
532559
endtry
533560
endfunc
534561

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1543,
746748
/**/
747749
1542,
748750
/**/

0 commit comments

Comments
 (0)