mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 8.1.0844: when timer fails test will hang forever
Problem: When timer fails test will hang forever. Solution: Use reltime() to limit waiting time. (Ozaki Kiichi, closes #3878)
This commit is contained in:
@@ -257,9 +257,11 @@ func Test_getchar_zero()
|
|||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Measure the elapsed time to avoid a hang when it fails.
|
||||||
|
let start = reltime()
|
||||||
let id = timer_start(20, {id -> feedkeys('x', 'L')})
|
let id = timer_start(20, {id -> feedkeys('x', 'L')})
|
||||||
let c = 0
|
let c = 0
|
||||||
while c == 0
|
while c == 0 && reltimefloat(reltime(start)) < 0.2
|
||||||
let c = getchar(0)
|
let c = getchar(0)
|
||||||
sleep 10m
|
sleep 10m
|
||||||
endwhile
|
endwhile
|
||||||
|
@@ -783,6 +783,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 */
|
||||||
|
/**/
|
||||||
|
844,
|
||||||
/**/
|
/**/
|
||||||
843,
|
843,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user