aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/timer_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-10 22:21:06 +0300
committerZyX <kp-pav@yandex.ru>2017-04-10 22:21:06 +0300
commitab4d13e2fa09db538756cc5cfb36f81681e5ff7a (patch)
treeb8bded415655f09bc323a23d21ed8d7e74b1c8da /test/functional/eval/timer_spec.lua
parenta40a969e9a4776f1e274dcf0e59c8f1ec1770ca0 (diff)
parent9aface8c4d1edd25d4fed3e099e3c2c02b0a282a (diff)
downloadrneovim-ab4d13e2fa09db538756cc5cfb36f81681e5ff7a.tar.gz
rneovim-ab4d13e2fa09db538756cc5cfb36f81681e5ff7a.tar.bz2
rneovim-ab4d13e2fa09db538756cc5cfb36f81681e5ff7a.zip
Merge branch 'master' into luaviml'/lua
Diffstat (limited to 'test/functional/eval/timer_spec.lua')
-rw-r--r--test/functional/eval/timer_spec.lua26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/functional/eval/timer_spec.lua b/test/functional/eval/timer_spec.lua
index b3c4cd07eb..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)
@@ -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([[