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.
427dddf014
This commit is contained in:
zeertzjq
2022-07-08 10:17:42 +08:00
parent 9bea841925
commit 061e573e7e

View File

@@ -158,6 +158,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()))
@@ -168,16 +169,18 @@ func StopTimerAll(timer)
endfunc endfunc
func Test_timer_stop_all_in_callback() func Test_timer_stop_all_in_callback()
call timer_stopall() call assert_equal(0, len(timer_info()))
let g:timer1 = timer_start(10, 'StopTimerAll') call timer_start(10, 'StopTimerAll')
let info = timer_info() call assert_equal(1, len(timer_info()))
call assert_equal(1, len(info)) let slept = 0
if has('mac') for i in range(10)
sleep 100m if len(timer_info()) == 0
break
endif endif
sleep 40m sleep 10m
let info = timer_info() let slept += 10
call assert_equal(0, len(info)) endfor
call assert_inrange(0, 30, slept)
endfunc endfunc
func FeedkeysCb(timer) func FeedkeysCb(timer)