diff options
-rw-r--r-- | src/nvim/testdir/test_timers.vim | 5 | ||||
-rw-r--r-- | test/functional/eval/timer_spec.lua | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim index da61751bf4..8a3e57bb02 100644 --- a/src/nvim/testdir/test_timers.vim +++ b/src/nvim/testdir/test_timers.vim @@ -44,7 +44,7 @@ func Test_repeat_many() let timer = timer_start(50, 'MyHandler', {'repeat': -1}) sleep 200m call timer_stop(timer) - call assert_inrange(2, 4, g:val) + call assert_inrange((has('mac') ? 1 : 2), 4, g:val) endfunc func Test_with_partial_callback() @@ -167,6 +167,9 @@ func Test_stop_all_in_callback() 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)) diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index c945f12e0e..d6fba112f1 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -82,7 +82,7 @@ describe('timers', function() run(nil, nil, nil, 300) feed("c") local count = eval("g:val") - assert(count >= 4, 'expected count >= 4, got: '..tostring(count)) + assert(count >= 3, 'expected count >= 3, got: '..tostring(count)) eq(99, eval("g:c")) end) @@ -144,8 +144,8 @@ describe('timers', function() local count2 = eval("g:val") -- when count is eval:ed after timer_stop this should be non-racy eq(count, count2) - assert(4 <= count and count <= 7, - 'expected (4 <= count <= 7), got: '..tostring(count)) + assert(3 <= count and count <= 7, + 'expected (3 <= count <= 7), got: '..tostring(count)) end) it('can be stopped from the handler', function() |