mirror of
https://github.com/vim/vim.git
synced 2025-09-29 04:34:16 -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
|
||||
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 c = 0
|
||||
while c == 0
|
||||
while c == 0 && reltimefloat(reltime(start)) < 0.2
|
||||
let c = getchar(0)
|
||||
sleep 10m
|
||||
endwhile
|
||||
|
@@ -783,6 +783,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
844,
|
||||
/**/
|
||||
843,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user