comparison src/testdir/test_timers.vim @ 26484:d945799b4604 v8.2.3772

patch 8.2.3772: timer info test fails on slow machine Commit: https://github.com/vim/vim/commit/ff39a650b2bd31e30d1bb8766e8560f9a14a7137 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 10 10:57:08 2021 +0000 patch 8.2.3772: timer info test fails on slow machine Problem: Timer info test fails on slow machine. Solution: Use WaitForAssert().
author Bram Moolenaar <Bram@vim.org>
date Fri, 10 Dec 2021 12:00:04 +0100
parents 7426c2657710
children 841145bb9885
comparison
equal deleted inserted replaced
26483:a0a1ec1776e3 26484:d945799b4604
119 call assert_fails('call timer_info("abc")', 'E39:') 119 call assert_fails('call timer_info("abc")', 'E39:')
120 120
121 " check repeat count inside the callback 121 " check repeat count inside the callback
122 let g:timer_repeat = [] 122 let g:timer_repeat = []
123 let tid = timer_start(10, {tid -> execute("call add(g:timer_repeat, timer_info(tid)[0].repeat)")}, #{repeat: 3}) 123 let tid = timer_start(10, {tid -> execute("call add(g:timer_repeat, timer_info(tid)[0].repeat)")}, #{repeat: 3})
124 sleep 100m 124 call WaitForAssert({-> assert_equal([2, 1, 0], g:timer_repeat)})
125 call assert_equal([2, 1, 0], g:timer_repeat)
126 unlet g:timer_repeat 125 unlet g:timer_repeat
127 endfunc 126 endfunc
128 127
129 func Test_timer_stopall() 128 func Test_timer_stopall()
130 let id1 = timer_start(1000, 'MyHandler') 129 let id1 = timer_start(1000, 'MyHandler')