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.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_timers.vim b/src/nvim/testdir/test_timers.vim
index 16c70b166b..6a8b09c898 100644
--- a/src/nvim/testdir/test_timers.vim
+++ b/src/nvim/testdir/test_timers.vim
@@ -125,4 +125,19 @@ func Test_paused()
endif
endfunc
+func StopMyself(timer)
+ let g:called += 1
+ if g:called == 2
+ call timer_stop(a:timer)
+ endif
+endfunc
+
+func Test_delete_myself()
+ let g:called = 0
+ let t = timer_start(10, 'StopMyself', {'repeat': -1})
+ call WaitFor('g:called == 2')
+ call assert_equal(2, g:called)
+ call assert_equal([], timer_info(t))
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab