diff src/testdir/test_timers.vim @ 8734:986f7c00d43d v7.4.1656

commit https://github.com/vim/vim/commit/92e35efaf6a3278e4729115648997f09cd4005f5 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 26 18:20:41 2016 +0100 patch 7.4.1656 Problem: Crash when using partial with a timer. Solution: Increment partial reference count. (Hirohito Higashi)
author Christian Brabandt <cb@256bit.org>
date Sat, 26 Mar 2016 18:30:06 +0100
parents 63dc856bd13d
children c2fe86f2bda1
line wrap: on
line diff
--- a/src/testdir/test_timers.vim
+++ b/src/testdir/test_timers.vim
@@ -30,3 +30,16 @@ 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
+" vim: ts=2 sw=0 et