neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 061e573e7ed4fc01c0589018958b3734b4dd3bcf
parent 9bea841925bd7af0bea56aff109230f5c33195fe
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Fri,  8 Jul 2022 10:17:42 +0800

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.
https://github.com/vim/vim/commit/427dddf014fea1326ea7f8c0951b0667dc037409

Diffstat:
Msrc/nvim/testdir/test_timers.vim | 23+++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim @@ -158,6 +158,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())) @@ -168,16 +169,18 @@ func StopTimerAll(timer) endfunc func Test_timer_stop_all_in_callback() - call timer_stopall() - let g:timer1 = timer_start(10, 'StopTimerAll') - let info = timer_info() - call assert_equal(1, len(info)) - if has('mac') - sleep 100m - endif - 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)