File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -994,6 +994,39 @@ func Test_reuse_channel()
994994 endtry
995995endfunc
996996
997+ func Test_out_cb ()
998+ if ! has (' job' )
999+ return
1000+ endif
1001+ call ch_log (' Test_out_cb()' )
1002+
1003+ let dict = {' thisis' : ' dict: ' }
1004+ func dict .outHandler (chan, msg) dict
1005+ let s: outmsg = self .thisis . a: msg
1006+ endfunc
1007+ func dict .errHandler (chan, msg) dict
1008+ let s: errmsg = self .thisis . a: msg
1009+ endfunc
1010+ let job = job_start (s: python . " test_channel_pipe.py" ,
1011+ \ {' out_cb' : dict .outHandler,
1012+ \ ' out_mode' : ' json' ,
1013+ \ ' err_cb' : dict .errHandler,
1014+ \ ' err_mode' : ' json' })
1015+ call assert_equal (" run" , job_status (job))
1016+ try
1017+ let s: outmsg = ' '
1018+ let s: errmsg = ' '
1019+ call ch_sendraw (job, " echo [0, \" hello\" ]\n " )
1020+ call ch_sendraw (job, " echoerr [0, \" there\" ]\n " )
1021+ call s: waitFor (' s:outmsg != ""' )
1022+ call assert_equal (" dict: hello" , s: outmsg )
1023+ call s: waitFor (' s:errmsg != ""' )
1024+ call assert_equal (" dict: there" , s: errmsg )
1025+ finally
1026+ call job_stop (job)
1027+ endtry
1028+ endfunc
1029+
9971030" """""""""
9981031
9991032let s: unletResponse = ' '
Original file line number Diff line number Diff line change @@ -748,6 +748,8 @@ static char *(features[]) =
748748
749749static int included_patches [] =
750750{ /* Add new patch number below this line */
751+ /**/
752+ 1627 ,
751753/**/
752754 1626 ,
753755/**/
You can’t perform that action at this time.
0 commit comments