Patch 9.0.0508
Problem: When the channel test fails there is no clue why.
Solution: Add info about the job status. (Ken Takata, closes #11175)
Files: src/testdir/test_channel.vim
*** ../vim-9.0.0507/src/testdir/test_channel.vim 2022-09-08
16:39:16.908140173 +0100
--- src/testdir/test_channel.vim 2022-09-20 11:02:30.847052666 +0100
***************
*** 1633,1639 ****
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 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')
let elapsed = reltimefloat(g:exit_cb_val.end)
call assert_inrange(0.5, 1.0, elapsed)
--- 1633,1644 ----
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 g:exit_cb_val.process = job_info(job).process
! 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)
call assert_inrange(0.5, 1.0, elapsed)
***************
*** 1964,1971 ****
let cmd = [&shell, &shellcmdflag, 'echo $FOO']
endif
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'}})
! call WaitForAssert({-> assert_equal("bar", g:envstr)})
unlet g:envstr
endfunc
--- 1969,1978 ----
let cmd = [&shell, &shellcmdflag, 'echo $FOO']
endif
call assert_fails('call job_start(cmd, {"env": 1})', 'E475:')
! let job = job_start(cmd, {'callback': {ch,msg -> execute(":let g:envstr .=
msg")}, 'env': {'FOO': 'bar'}})
! if WaitForAssert({-> assert_equal("bar", g:envstr)}, 500) != 0
! call add(v:errors, "Job status: " .. string(job->job_info()))
! endif
unlet g:envstr
endfunc
***************
*** 2027,2033 ****
try
let g:out = ''
let job = job_start([s:python, '-c', a:cmd], {'callback': {ch, msg ->
execute('let g:out .= msg')}, 'out_mode': 'raw'})
! call WaitFor('"" != g:out')
if has('win32')
let g:out = substitute(g:out, '\r', '', 'g')
endif
--- 2034,2045 ----
try
let g:out = ''
let job = job_start([s:python, '-c', a:cmd], {'callback': {ch, msg ->
execute('let g:out .= msg')}, 'out_mode': 'raw'})
! try
! call WaitFor('"" != g:out')
! catch
! call add(v:errors, "Job status: " .. string(job->job_info()))
! throw v:exception
! endtry
if has('win32')
let g:out = substitute(g:out, '\r', '', 'g')
endif
*** ../vim-9.0.0507/src/version.c 2022-09-19 21:15:52.085717048 +0100
--- src/version.c 2022-09-20 11:03:30.786542427 +0100
***************
*** 701,702 ****
--- 701,704 ----
{ /* Add new patch number below this line */
+ /**/
+ 508,
/**/
--
hundred-and-one symptoms of being an internet addict:
101. U can read htis w/o ny porblm and cant figur eout Y its evn listd.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220920100537.467B01C08A0%40moolenaar.net.