patch 8.2.0203: :helptags and some other functionality not tested
Problem: :helptags and some other functionality not tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5567)
diff --git a/src/testdir/test_timers.vim b/src/testdir/test_timers.vim
index 383aff5..37af18c 100644
--- a/src/testdir/test_timers.vim
+++ b/src/testdir/test_timers.vim
@@ -110,6 +110,8 @@
call timer_stop(id)
call assert_equal([], timer_info(id))
+
+ call assert_fails('call timer_info("abc")', 'E39:')
endfunc
func Test_timer_stopall()
@@ -152,6 +154,8 @@
else
call assert_inrange(0, 10, slept)
endif
+
+ call assert_fails('call timer_pause("abc", 1)', 'E39:')
endfunc
func StopMyself(timer)
@@ -246,6 +250,10 @@
call WaitForAssert({-> assert_equal(3, g:call_count)})
sleep 50m
call assert_equal(3, g:call_count)
+
+ call assert_fails('call timer_start(100, "MyHandler", "abc")', 'E475:')
+ call assert_fails('call timer_start(100, [])', 'E921:')
+ call assert_fails('call timer_stop("abc")', 'E39:')
endfunc
func FuncWithCaughtError(timer)
@@ -405,4 +413,13 @@
exe buf .. 'bwipe!'
endfunc
+" Test for garbage collection when a timer is still running
+func Test_timer_garbage_collect()
+ let timer = timer_start(1000, function('MyHandler'), {'repeat' : 10})
+ call test_garbagecollect_now()
+ let l = timer_info(timer)
+ call assert_equal(function('MyHandler'), l[0].callback)
+ call timer_stop(timer)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab