aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_timers.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_timers.vim')
-rw-r--r--src/nvim/testdir/test_timers.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim
index 9f58a35909..d92cbe6897 100644
--- a/src/nvim/testdir/test_timers.vim
+++ b/src/nvim/testdir/test_timers.vim
@@ -8,6 +8,10 @@ func MyHandler(timer)
let s:val += 1
endfunc
+func MyHandlerWithLists(lists, timer)
+ let x = string(a:lists)
+endfunc
+
func Test_oneshot()
let s:val = 0
let timer = timer_start(50, 'MyHandler')
@@ -30,3 +34,22 @@ func Test_repeat_many()
call assert_true(s:val > 1)
call assert_true(s:val < 5)
endfunc
+
+func Test_with_partial_callback()
+ let s:val = 0
+ let s:meow = {}
+ function s:meow.bite(...)
+ let s:val += 1
+ endfunction
+
+ call timer_start(50, s:meow.bite)
+ sleep 200m
+ call assert_equal(1, s:val)
+endfunc
+
+func Test_retain_partial()
+ call timer_start(100, function('MyHandlerWithLists', [['a']]))
+ call garbagecollect()
+ sleep 200m
+endfunc
+" vim: ts=2 sw=0 et