aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-09 10:23:57 +0200
committerGitHub <noreply@github.com>2019-08-09 10:23:57 +0200
commit4bb728dfa093d462dfbe581643c3ac7953b54937 (patch)
treec0a8c9e151ee647f6bfda9c59fc26dc91ad839a0 /test/functional/helpers.lua
parent25fff17d19f5927987526bd4d7c4bd4b73603241 (diff)
downloadrneovim-4bb728dfa093d462dfbe581643c3ac7953b54937.tar.gz
rneovim-4bb728dfa093d462dfbe581643c3ac7953b54937.tar.bz2
rneovim-4bb728dfa093d462dfbe581643c3ac7953b54937.zip
test: Minimize shada/helpers.lua #10728
Diffstat (limited to 'test/functional/helpers.lua')
-rw-r--r--test/functional/helpers.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 92c83b5f49..4dde733e1e 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -419,6 +419,14 @@ end
-- clear('-e')
-- clear{args={'-e'}, args_rm={'-i'}, env={TERM=term}}
function module.clear(...)
+ local argv, env = module.new_argv(...)
+ module.set_session(module.spawn(argv, nil, env))
+end
+
+-- Builds an argument list for use in clear().
+--
+--@see clear() for parameters.
+function module.new_argv(...)
local args = {unpack(module.nvim_argv)}
table.insert(args, '--headless')
local new_args
@@ -458,7 +466,7 @@ function module.clear(...)
for _, arg in ipairs(new_args) do
table.insert(args, arg)
end
- module.set_session(module.spawn(args, nil, env))
+ return args, env
end
function module.insert(...)