" Test for channel functions.
if !has('channel')
finish
endif
source shared.vim
let s:python = PythonProg()
if s:python == ''
" Can't run this test.
finish
endif
let s:chopt = {}
" Run "testfunc" after sarting the server and stop the server afterwards.
func s:run_server(testfunc, ...)
call RunServer('test_channel.py', a:testfunc, a:000)
endfunc
let g:Ch_responseMsg = ''
func Ch_requestHandler(handle, msg)
let g:Ch_responseHandle = a:handle
let g:Ch_responseMsg = a:msg
endfunc
func Ch_communicate(port)
let handle = ch_open('localhost:' . a:port, s:chopt)
if ch_status(handle) == "fail"
call assert_false(1, "Can't open channel")
return
endif
if has('job')
" check that getjob without a job is handled correctly
call assert_equal('no process', string(ch_getjob(handle)))
endif
let dict = ch_info(handle)
call assert_true(dict.id != 0)
call assert_equal('open', dict.sta