aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/timer_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-06-05 10:49:33 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-06-29 18:57:18 +0200
commit2c39e0b03f083bac569901b62f0058559bacfc63 (patch)
tree8f33e8e185bfad3a6efa590bf637c74518beaa01 /test/functional/eval/timer_spec.lua
parent204f557a11e27b20a0343788500b4bdda36d4c3f (diff)
downloadrneovim-2c39e0b03f083bac569901b62f0058559bacfc63.tar.gz
rneovim-2c39e0b03f083bac569901b62f0058559bacfc63.tar.bz2
rneovim-2c39e0b03f083bac569901b62f0058559bacfc63.zip
timers: make timers work with zero timeout
Diffstat (limited to 'test/functional/eval/timer_spec.lua')
-rw-r--r--test/functional/eval/timer_spec.lua7
1 files changed, 7 insertions, 0 deletions
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