aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/helpers.lua8
-rw-r--r--test/functional/shada/helpers.lua8
2 files changed, 5 insertions, 11 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 4e294029ab..919e6e077b 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -59,6 +59,9 @@ end
local session, loop_running, last_error
local function set_session(s)
+ if session then
+ session:exit(0)
+ end
session = s
end
@@ -218,15 +221,12 @@ local function spawn(argv, merge)
end
local function clear(extra_cmd)
- if session then
- session:exit(0)
- end
local args = {unpack(nvim_argv)}
if extra_cmd ~= nil then
table.insert(args, '--cmd')
table.insert(args, extra_cmd)
end
- session = spawn(args)
+ set_session(spawn(args))
end
local function insert(...)
diff --git a/test/functional/shada/helpers.lua b/test/functional/shada/helpers.lua
index 146ae8d51e..cc554097c6 100644
--- a/test/functional/shada/helpers.lua
+++ b/test/functional/shada/helpers.lua
@@ -20,14 +20,8 @@ local function nvim_argv()
end
end
-local session = nil
-
local reset = function()
- if session then
- session:exit(0)
- end
- session = spawn(nvim_argv())
- set_session(session)
+ set_session(spawn(nvim_argv()))
meths.set_var('tmpname', tmpname)
end