aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/ex_terminal_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/terminal/ex_terminal_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/terminal/ex_terminal_spec.lua')
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 9bb683f25f..154374cda9 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, wait, nvim = helpers.clear, helpers.wait, helpers.nvim
local nvim_dir, source, eq = helpers.nvim_dir, helpers.source, helpers.eq
-local execute, eval = helpers.execute, helpers.eval
+local feed_command, eval = helpers.feed_command, helpers.eval
if helpers.pending_win32(pending) then return end
@@ -23,11 +23,11 @@ describe(':terminal', function()
echomsg "msg3"
]])
-- Invoke a command that emits frequent terminal activity.
- execute([[terminal while true; do echo X; done]])
+ feed_command([[terminal while true; do echo X; done]])
helpers.feed([[<C-\><C-N>]])
wait()
helpers.sleep(10) -- Let some terminal activity happen.
- execute("messages")
+ feed_command("messages")
screen:expect([[
msg1 |
msg2 |
@@ -37,14 +37,14 @@ describe(':terminal', function()
end)
it("in normal-mode :split does not move cursor", function()
- execute([[terminal while true; do echo foo; sleep .1; done]])
+ feed_command([[terminal while true; do echo foo; sleep .1; done]])
helpers.feed([[<C-\><C-N>M]]) -- move cursor away from last line
wait()
eq(3, eval("line('$')")) -- window height
eq(2, eval("line('.')")) -- cursor is in the middle
- execute('vsplit')
+ feed_command('vsplit')
eq(2, eval("line('.')")) -- cursor stays where we put it
- execute('split')
+ feed_command('split')
eq(2, eval("line('.')")) -- cursor stays where we put it
end)
@@ -65,7 +65,7 @@ describe(':terminal (with fake shell)', function()
-- Invokes `:terminal {cmd}` using a fake shell (shell-test.c) which prints
-- the {cmd} and exits immediately .
local function terminal_with_fake_shell(cmd)
- execute("terminal "..(cmd and cmd or ""))
+ feed_command("terminal "..(cmd and cmd or ""))
end
it('with no argument, acts like termopen()', function()
@@ -157,7 +157,7 @@ describe(':terminal (with fake shell)', function()
end)
it('works with findfile()', function()
- execute('terminal')
+ feed_command('terminal')
eq('term://', string.match(eval('bufname("%")'), "^term://"))
eq('scripts/shadacat.py', eval('findfile("scripts/shadacat.py", ".")'))
end)
@@ -173,7 +173,7 @@ describe(':terminal (with fake shell)', function()
]])
eq('term://', string.match(eval('bufname("%")'), "^term://"))
helpers.feed([[<C-\><C-N>]])
- execute([[find */shadacat.py]])
+ feed_command([[find */shadacat.py]])
eq('scripts/shadacat.py', eval('bufname("%")'))
end)