aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/timer_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/eval/timer_spec.lua')
-rw-r--r--test/functional/eval/timer_spec.lua28
1 files changed, 14 insertions, 14 deletions
diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua
index 4353619ff0..2dd9968a01 100644
--- a/test/functional/eval/timer_spec.lua
+++ b/test/functional/eval/timer_spec.lua
@@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local ok, feed, eq, eval = helpers.ok, helpers.feed, helpers.eq, helpers.eval
local source, nvim_async, run = helpers.source, helpers.nvim_async, helpers.run
-local clear, execute, funcs = helpers.clear, helpers.execute, helpers.funcs
+local clear, command, funcs = helpers.clear, helpers.command, helpers.funcs
local curbufmeths = helpers.curbufmeths
describe('timers', function()
@@ -17,14 +17,14 @@ describe('timers', function()
end)
it('works one-shot', function()
- execute("call timer_start(50, 'MyHandler')")
+ command("call timer_start(50, 'MyHandler')")
eq(0,eval("g:val"))
run(nil, nil, nil, 200)
eq(1,eval("g:val"))
end)
it('works one-shot when repeat=0', function()
- execute("call timer_start(50, 'MyHandler', {'repeat': 0})")
+ command("call timer_start(50, 'MyHandler', {'repeat': 0})")
eq(0,eval("g:val"))
run(nil, nil, nil, 200)
eq(1,eval("g:val"))
@@ -32,14 +32,14 @@ describe('timers', function()
it('works with repeat two', function()
- execute("call timer_start(50, 'MyHandler', {'repeat': 2})")
+ command("call timer_start(50, 'MyHandler', {'repeat': 2})")
eq(0,eval("g:val"))
run(nil, nil, nil, 300)
eq(2,eval("g:val"))
end)
it('are triggered during sleep', function()
- execute("call timer_start(50, 'MyHandler', {'repeat': 2})")
+ command("call timer_start(50, 'MyHandler', {'repeat': 2})")
nvim_async("command", "sleep 10")
eq(0,eval("g:val"))
run(nil, nil, nil, 300)
@@ -49,7 +49,7 @@ describe('timers', function()
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)
+ run(nil, nil, nil, 400)
eq(1000,eval("g:val"))
end)
@@ -63,12 +63,12 @@ describe('timers', function()
end)
it('are paused when event processing is disabled', function()
- execute("call timer_start(50, 'MyHandler', {'repeat': -1})")
+ command("call timer_start(50, 'MyHandler', {'repeat': -1})")
run(nil, nil, nil, 100)
local count = eval("g:val")
-- shows two line error message and thus invokes the return prompt.
-- if we start to allow event processing here, we need to change this test.
- execute("throw 'fatal error'")
+ feed(':throw "fatal error"<CR>')
run(nil, nil, nil, 300)
feed("<cr>")
local diff = eval("g:val") - count
@@ -76,7 +76,7 @@ describe('timers', function()
end)
it('are triggered in blocking getchar() call', function()
- execute("call timer_start(50, 'MyHandler', {'repeat': -1})")
+ command("call timer_start(50, 'MyHandler', {'repeat': -1})")
nvim_async("command", "let g:c = getchar()")
run(nil, nil, nil, 300)
feed("c")
@@ -157,7 +157,7 @@ describe('timers', function()
endif
endfunc
]])
- execute("call timer_start(50, 'MyHandler', {'repeat': -1})")
+ command("call timer_start(50, 'MyHandler', {'repeat': -1})")
eq(0,eval("g:val"))
run(nil, nil, nil, 300)
eq(3,eval("g:val"))
@@ -170,8 +170,8 @@ describe('timers', function()
let g:val2 += 1
endfunc
]])
- execute("call timer_start(50, 'MyHandler', {'repeat': 3})")
- execute("call timer_start(100, 'MyHandler2', {'repeat': 2})")
+ command("call timer_start(50, 'MyHandler', {'repeat': 3})")
+ command("call timer_start(100, 'MyHandler2', {'repeat': 2})")
run(nil, nil, nil, 300)
eq(3,eval("g:val"))
eq(2,eval("g:val2"))
@@ -186,7 +186,7 @@ describe('timers', function()
let g:val += 1
endfunc
]])
- execute("call timer_start(5, 'MyHandler', {'repeat': 1})")
+ command("call timer_start(5, 'MyHandler', {'repeat': 1})")
run(nil, nil, nil, 300)
eq(1,eval("g:val"))
end)
@@ -201,7 +201,7 @@ describe('timers', function()
echo "evil"
endfunc
]])
- execute("call timer_start(100, 'MyHandler', {'repeat': 1})")
+ command("call timer_start(100, 'MyHandler', {'repeat': 1})")
feed(":good")
screen:sleep(200)
screen:expect([[