aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/write_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/ex_cmds/write_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/ex_cmds/write_spec.lua')
-rw-r--r--test/functional/ex_cmds/write_spec.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/functional/ex_cmds/write_spec.lua b/test/functional/ex_cmds/write_spec.lua
index 9c2687971e..ea8b41a578 100644
--- a/test/functional/ex_cmds/write_spec.lua
+++ b/test/functional/ex_cmds/write_spec.lua
@@ -1,11 +1,12 @@
local helpers = require('test.functional.helpers')(after_each)
local lfs = require('lfs')
-local eq, eval, clear, write_file, execute, source, insert =
+local eq, eval, clear, write_file, command, source, insert =
helpers.eq, helpers.eval, helpers.clear, helpers.write_file,
- helpers.execute, helpers.source, helpers.insert
+ helpers.command, helpers.source, helpers.insert
local redir_exec = helpers.redir_exec
local exc_exec = helpers.exc_exec
local command = helpers.command
+local feed_command = helpers.feed_command
local funcs = helpers.funcs
local meths = helpers.meths
@@ -33,9 +34,9 @@ describe(':write', function()
end)
it('&backupcopy=auto preserves symlinks', function()
- execute('set backupcopy=auto')
+ command('set backupcopy=auto')
write_file('test_bkc_file.txt', 'content0')
- execute("silent !ln -s test_bkc_file.txt test_bkc_link.txt")
+ command("silent !ln -s test_bkc_file.txt test_bkc_link.txt")
source([[
edit test_bkc_link.txt
call setline(1, ['content1'])
@@ -46,9 +47,9 @@ describe(':write', function()
end)
it('&backupcopy=no replaces symlink with new file', function()
- execute('set backupcopy=no')
+ command('set backupcopy=no')
write_file('test_bkc_file.txt', 'content0')
- execute("silent !ln -s test_bkc_file.txt test_bkc_link.txt")
+ command("silent !ln -s test_bkc_file.txt test_bkc_link.txt")
source([[
edit test_bkc_link.txt
call setline(1, ['content1'])
@@ -69,7 +70,7 @@ describe(':write', function()
insert(text)
-- Blocks until a consumer reads the FIFO.
- execute("write >> test_fifo")
+ feed_command("write >> test_fifo")
-- Read the FIFO, this will unblock the :write above.
local fifo = assert(io.open("test_fifo"))