summaryrefslogtreecommitdiff
path: root/src/testdir/test_timers.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-08-16 21:22:41 +0200
committerBram Moolenaar <Bram@vim.org>2019-08-16 21:22:41 +0200
commit427dddf014fea1326ea7f8c0951b0667dc037409 (patch)
treeff6f7ee99de412c94ab00fc0ebf40941479b8168 /src/testdir/test_timers.vim
parent2f710afe7f166973c879bf7424678ba84368c1bb (diff)
downloadvim-git-427dddf014fea1326ea7f8c0951b0667dc037409.tar.gz
patch 8.1.1859: timer test sometimes fails on Macv8.1.1859
Problem: Timer test sometimes fails on Mac. Solution: Show more info when it fails.
Diffstat (limited to 'src/testdir/test_timers.vim')
-rw-r--r--src/testdir/test_timers.vim19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim
index e504a89f3..dc01d84b8 100644
--- a/src/testdir/test_timers.vim
+++ b/src/testdir/test_timers.vim
@@ -160,6 +160,7 @@ func StopTimer2(timer)
endfunc
func Test_timer_stop_in_callback()
+ call assert_equal(0, len(timer_info()))
let g:timer1 = timer_start(10, 'StopTimer1')
sleep 40m
call assert_equal(0, len(timer_info()))
@@ -170,12 +171,18 @@ func StopTimerAll(timer)
endfunc
func Test_timer_stop_all_in_callback()
- let g:timer1 = timer_start(10, 'StopTimerAll')
- let info = timer_info()
- call assert_equal(1, len(info))
- sleep 40m
- let info = timer_info()
- call assert_equal(0, len(info))
+ call assert_equal(0, len(timer_info()))
+ call timer_start(10, 'StopTimerAll')
+ call assert_equal(1, len(timer_info()))
+ let slept = 0
+ for i in range(10)
+ if len(timer_info()) == 0
+ break
+ endif
+ sleep 10m
+ let slept += 10
+ endfor
+ call assert_inrange(0, 30, slept)
endfunc
func FeedkeysCb(timer)