aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/api_functions_spec.lua
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-04-09 00:12:26 +0300
committerZyX <kp-pav@yandex.ru>2017-04-09 03:24:08 +0300
commit65fb622000af8e3dbb65480e1581758ecf4ba3e2 (patch)
tree7d83429d3762b1f0a44d04eb8fc780eedc0ec049 /test/functional/eval/api_functions_spec.lua
parent9158cc171f46ebae0a0d3d1721aa5b7d829bcba5 (diff)
downloadrneovim-65fb622000af8e3dbb65480e1581758ecf4ba3e2.tar.gz
rneovim-65fb622000af8e3dbb65480e1581758ecf4ba3e2.tar.bz2
rneovim-65fb622000af8e3dbb65480e1581758ecf4ba3e2.zip
functests: Replace execute with either command or feed_command
Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed.
Diffstat (limited to 'test/functional/eval/api_functions_spec.lua')
-rw-r--r--test/functional/eval/api_functions_spec.lua22
1 files changed, 11 insertions, 11 deletions
diff --git a/test/functional/eval/api_functions_spec.lua b/test/functional/eval/api_functions_spec.lua
index 21dd228145..7f6f53d226 100644
--- a/test/functional/eval/api_functions_spec.lua
+++ b/test/functional/eval/api_functions_spec.lua
@@ -1,7 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local lfs = require('lfs')
-local neq, eq, execute = helpers.neq, helpers.eq, helpers.execute
+local neq, eq, command = helpers.neq, helpers.eq, helpers.command
local clear, curbufmeths = helpers.clear, helpers.curbufmeths
local exc_exec, expect, eval = helpers.exc_exec, helpers.expect, helpers.eval
local insert = helpers.insert
@@ -10,17 +10,17 @@ describe('api functions', function()
before_each(clear)
it("work", function()
- execute("call nvim_command('let g:test = 1')")
+ command("call nvim_command('let g:test = 1')")
eq(1, eval("nvim_get_var('test')"))
local buf = eval("nvim_get_current_buf()")
- execute("call nvim_buf_set_lines("..buf..", 0, -1, v:true, ['aa', 'bb'])")
+ command("call nvim_buf_set_lines("..buf..", 0, -1, v:true, ['aa', 'bb'])")
expect([[
aa
bb]])
- execute("call nvim_win_set_cursor(0, [1, 1])")
- execute("call nvim_input('ax<esc>')")
+ command("call nvim_win_set_cursor(0, [1, 1])")
+ command("call nvim_input('ax<esc>')")
expect([[
aax
bb]])
@@ -57,7 +57,7 @@ describe('api functions', function()
eq(bnr, bhnd)
eq(wid, whnd)
- execute("new") -- creates new buffer and new window
+ command("new") -- creates new buffer and new window
local bnr2 = eval("bufnr('')")
local bhnd2 = eval("nvim_get_current_buf()")
local wid2 = eval("win_getid()")
@@ -69,7 +69,7 @@ describe('api functions', function()
-- 0 is synonymous to the current buffer
eq(bnr2, eval("nvim_buf_get_number(0)"))
- execute("bn") -- show old buffer in new window
+ command("bn") -- show old buffer in new window
eq(bnr, eval("nvim_get_current_buf()"))
eq(bnr, eval("bufnr('')"))
eq(bnr, eval("nvim_buf_get_number(0)"))
@@ -81,7 +81,7 @@ describe('api functions', function()
curbufmeths.set_lines(0, -1, true, {"aa\0", "b\0b"})
eq({'aa\n', 'b\nb'}, eval("nvim_buf_get_lines(0, 0, -1, 1)"))
- execute('call nvim_buf_set_lines(0, 1, 2, v:true, ["xx", "\\nyy"])')
+ command('call nvim_buf_set_lines(0, 1, 2, v:true, ["xx", "\\nyy"])')
eq({'aa\0', 'xx', '\0yy'}, curbufmeths.get_lines(0, -1, 1))
end)
@@ -124,9 +124,9 @@ describe('api functions', function()
[5] = {bold = true, foreground = Screen.colors.Blue},
})
- execute("set ft=vim")
- execute("let &rtp='build/runtime/,'.&rtp")
- execute("syntax on")
+ command("set ft=vim")
+ command("let &rtp='build/runtime/,'.&rtp")
+ command("syntax on")
insert([[
call bufnr('%')
call nvim_input('typing...')