mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0108
Problem: The channel "drop" option is not tested. Solution: Add a test.
This commit is contained in:
@@ -129,6 +129,9 @@ func Ch_communicate(port)
|
|||||||
call ch_setoptions(handle, {'mode': 'json'})
|
call ch_setoptions(handle, {'mode': 'json'})
|
||||||
call assert_fails("call ch_setoptions(handle, {'waittime': 111})", "E475")
|
call assert_fails("call ch_setoptions(handle, {'waittime': 111})", "E475")
|
||||||
call ch_setoptions(handle, {'callback': ''})
|
call ch_setoptions(handle, {'callback': ''})
|
||||||
|
call ch_setoptions(handle, {'drop': 'never'})
|
||||||
|
call ch_setoptions(handle, {'drop': 'auto'})
|
||||||
|
call assert_fails("call ch_setoptions(handle, {'drop': 'bad'})", "E475")
|
||||||
|
|
||||||
" Send an eval request that works.
|
" Send an eval request that works.
|
||||||
call assert_equal('ok', ch_evalexpr(handle, 'eval-works'))
|
call assert_equal('ok', ch_evalexpr(handle, 'eval-works'))
|
||||||
@@ -249,6 +252,7 @@ endfunc
|
|||||||
"""""""""
|
"""""""""
|
||||||
|
|
||||||
func Ch_handler(chan, msg)
|
func Ch_handler(chan, msg)
|
||||||
|
call ch_log('Ch_handler()')
|
||||||
unlet g:Ch_reply
|
unlet g:Ch_reply
|
||||||
let g:Ch_reply = a:msg
|
let g:Ch_reply = a:msg
|
||||||
endfunc
|
endfunc
|
||||||
@@ -272,6 +276,7 @@ func Ch_channel_handler(port)
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_channel_handler()
|
func Test_channel_handler()
|
||||||
|
call ch_logfile('channellog', 'w')
|
||||||
call ch_log('Test_channel_handler()')
|
call ch_log('Test_channel_handler()')
|
||||||
let g:Ch_reply = ""
|
let g:Ch_reply = ""
|
||||||
let s:chopt.callback = 'Ch_handler'
|
let s:chopt.callback = 'Ch_handler'
|
||||||
@@ -437,7 +442,7 @@ func Test_raw_pipe()
|
|||||||
" Add a dummy close callback to avoid that messages are dropped when calling
|
" Add a dummy close callback to avoid that messages are dropped when calling
|
||||||
" ch_canread().
|
" ch_canread().
|
||||||
let job = job_start(s:python . " test_channel_pipe.py",
|
let job = job_start(s:python . " test_channel_pipe.py",
|
||||||
\ {'mode': 'raw', 'close_cb': {chan -> 0}})
|
\ {'mode': 'raw', 'drop': 'never'})
|
||||||
call assert_equal(v:t_job, type(job))
|
call assert_equal(v:t_job, type(job))
|
||||||
call assert_equal("run", job_status(job))
|
call assert_equal("run", job_status(job))
|
||||||
|
|
||||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
108,
|
||||||
/**/
|
/**/
|
||||||
107,
|
107,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user