forked from aniani/vim
patch 8.1.1859: timer test sometimes fails on Mac
Problem: Timer test sometimes fails on Mac. Solution: Show more info when it fails.
This commit is contained in:
@@ -160,6 +160,7 @@ func StopTimer2(timer)
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_timer_stop_in_callback()
|
func Test_timer_stop_in_callback()
|
||||||
|
call assert_equal(0, len(timer_info()))
|
||||||
let g:timer1 = timer_start(10, 'StopTimer1')
|
let g:timer1 = timer_start(10, 'StopTimer1')
|
||||||
sleep 40m
|
sleep 40m
|
||||||
call assert_equal(0, len(timer_info()))
|
call assert_equal(0, len(timer_info()))
|
||||||
@@ -170,12 +171,18 @@ func StopTimerAll(timer)
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_timer_stop_all_in_callback()
|
func Test_timer_stop_all_in_callback()
|
||||||
let g:timer1 = timer_start(10, 'StopTimerAll')
|
call assert_equal(0, len(timer_info()))
|
||||||
let info = timer_info()
|
call timer_start(10, 'StopTimerAll')
|
||||||
call assert_equal(1, len(info))
|
call assert_equal(1, len(timer_info()))
|
||||||
sleep 40m
|
let slept = 0
|
||||||
let info = timer_info()
|
for i in range(10)
|
||||||
call assert_equal(0, len(info))
|
if len(timer_info()) == 0
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
sleep 10m
|
||||||
|
let slept += 10
|
||||||
|
endfor
|
||||||
|
call assert_inrange(0, 30, slept)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func FeedkeysCb(timer)
|
func FeedkeysCb(timer)
|
||||||
|
|||||||
@@ -769,6 +769,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 */
|
||||||
|
/**/
|
||||||
|
1859,
|
||||||
/**/
|
/**/
|
||||||
1858,
|
1858,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user