aboutsummaryrefslogtreecommitdiff
path: root/test/functional/helpers.lua
diff options
context:
space:
mode:
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(...)