0
0
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:
Bram Moolenaar
2019-01-29 20:36:56 +01:00
parent e0de2164f6
commit 50948e4ac2
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -783,6 +783,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
844,
/**/
843,
/**/