forked from aniani/vim
patch 9.0.0508: when the channel test fails there is no clue why
Problem: When the channel test fails there is no clue why. Solution: Add info about the job status. (Ken Takata, closes #11175)
This commit is contained in:
@@ -1633,7 +1633,12 @@ func Test_exit_callback_interval()
|
|||||||
let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0}
|
let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0}
|
||||||
let job = [s:python, '-c', 'import time;time.sleep(0.5)']->job_start({'exit_cb': 'MyExitTimeCb'})
|
let job = [s:python, '-c', 'import time;time.sleep(0.5)']->job_start({'exit_cb': 'MyExitTimeCb'})
|
||||||
let g:exit_cb_val.process = job_info(job).process
|
let g:exit_cb_val.process = job_info(job).process
|
||||||
call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0')
|
try
|
||||||
|
call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0')
|
||||||
|
catch
|
||||||
|
call add(v:errors, "Job status: " .. string(job->job_info()))
|
||||||
|
throw v:exception
|
||||||
|
endtry
|
||||||
let elapsed = reltimefloat(g:exit_cb_val.end)
|
let elapsed = reltimefloat(g:exit_cb_val.end)
|
||||||
call assert_inrange(0.5, 1.0, elapsed)
|
call assert_inrange(0.5, 1.0, elapsed)
|
||||||
|
|
||||||
@@ -1964,8 +1969,10 @@ func Test_env()
|
|||||||
let cmd = [&shell, &shellcmdflag, 'echo $FOO']
|
let cmd = [&shell, &shellcmdflag, 'echo $FOO']
|
||||||
endif
|
endif
|
||||||
call assert_fails('call job_start(cmd, {"env": 1})', 'E475:')
|
call assert_fails('call job_start(cmd, {"env": 1})', 'E475:')
|
||||||
call job_start(cmd, {'callback': {ch,msg -> execute(":let g:envstr .= msg")}, 'env': {'FOO': 'bar'}})
|
let job = job_start(cmd, {'callback': {ch,msg -> execute(":let g:envstr .= msg")}, 'env': {'FOO': 'bar'}})
|
||||||
call WaitForAssert({-> assert_equal("bar", g:envstr)})
|
if WaitForAssert({-> assert_equal("bar", g:envstr)}, 500) != 0
|
||||||
|
call add(v:errors, "Job status: " .. string(job->job_info()))
|
||||||
|
endif
|
||||||
unlet g:envstr
|
unlet g:envstr
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@@ -2027,7 +2034,12 @@ func s:test_list_args(cmd, out, remove_lf)
|
|||||||
try
|
try
|
||||||
let g:out = ''
|
let g:out = ''
|
||||||
let job = job_start([s:python, '-c', a:cmd], {'callback': {ch, msg -> execute('let g:out .= msg')}, 'out_mode': 'raw'})
|
let job = job_start([s:python, '-c', a:cmd], {'callback': {ch, msg -> execute('let g:out .= msg')}, 'out_mode': 'raw'})
|
||||||
call WaitFor('"" != g:out')
|
try
|
||||||
|
call WaitFor('"" != g:out')
|
||||||
|
catch
|
||||||
|
call add(v:errors, "Job status: " .. string(job->job_info()))
|
||||||
|
throw v:exception
|
||||||
|
endtry
|
||||||
if has('win32')
|
if has('win32')
|
||||||
let g:out = substitute(g:out, '\r', '', 'g')
|
let g:out = substitute(g:out, '\r', '', 'g')
|
||||||
endif
|
endif
|
||||||
|
@@ -699,6 +699,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 */
|
||||||
|
/**/
|
||||||
|
508,
|
||||||
/**/
|
/**/
|
||||||
507,
|
507,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user