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.vim31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim
index abf4e43ec3..136f32a80e 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')
@@ -31,15 +35,20 @@ func Test_repeat_many()
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_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