From 2c39e0b03f083bac569901b62f0058559bacfc63 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sun, 5 Jun 2016 10:49:33 +0200 Subject: timers: make timers work with zero timeout --- test/functional/eval/timer_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/functional/eval/timer_spec.lua') diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua index a31e942cdf..82b965c832 100644 --- a/test/functional/eval/timer_spec.lua +++ b/test/functional/eval/timer_spec.lua @@ -37,6 +37,13 @@ describe('timers', function() eq(2,eval("g:val")) end) + it('works with zero timeout', function() + -- timer_start does still not invoke the callback immediately + eq(0,eval("[timer_start(0, 'MyHandler', {'repeat': 1000}), g:val][1]")) + run(nil, nil, nil, 300) + eq(1000,eval("g:val")) + end) + it('can be started during sleep', function() nvim_async("command", "sleep 10") -- this also tests that remote requests works during sleep -- cgit