aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-04-17 01:38:59 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-04-27 16:31:26 +0200
commit698c4f662d3a30fab1e48dbe7586617a9031a6ea (patch)
tree733c226b0448d219e4097f50625812a0a809bec1
parent17291642bd9a58c39fb4d61f6b6170829a47c73e (diff)
downloadrneovim-698c4f662d3a30fab1e48dbe7586617a9031a6ea.tar.gz
rneovim-698c4f662d3a30fab1e48dbe7586617a9031a6ea.tar.bz2
rneovim-698c4f662d3a30fab1e48dbe7586617a9031a6ea.zip
test: clear(): remove `opts.headless` parameter
Callers can instead specify `args_rm={'--headless'}`. TODO: should `nvim_argv` have "--headless" by default? Need to inspect some uses of spawn(nvim_argv) ...
-rw-r--r--test/functional/helpers.lua9
-rw-r--r--test/functional/ui/embed_spec.lua2
-rw-r--r--test/functional/ui/messages_spec.lua2
-rw-r--r--test/functional/ui/multigrid_spec.lua2
-rw-r--r--test/functional/ui/options_spec.lua3
5 files changed, 6 insertions, 12 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 7cb562a776..7851a0fcba 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -394,17 +394,16 @@ end
-- removed, e.g. args_rm={'--cmd'} removes all cases of "--cmd"
-- (and its value) from the default set.
-- env: Map: Defines the environment of the new session.
--- headless: Boolean (default=true): Append --headless arg.
--
-- Example:
-- clear('-e')
-- clear{args={'-e'}, args_rm={'-i'}, env={TERM=term}}
local function clear(...)
local args = {unpack(nvim_argv)}
+ table.insert(args, '--headless')
local new_args
local env = nil
local opts = select(1, ...)
- local headless = true
if type(opts) == 'table' then
args = remove_args(args, opts.args_rm)
if opts.env then
@@ -432,15 +431,9 @@ local function clear(...)
end
end
new_args = opts.args or {}
- if opts.headless == false then
- headless = false
- end
else
new_args = {...}
end
- if headless then
- table.insert(args, '--headless')
- end
for _, arg in ipairs(new_args) do
table.insert(args, arg)
end
diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua
index 10dbc68672..9196c8af40 100644
--- a/test/functional/ui/embed_spec.lua
+++ b/test/functional/ui/embed_spec.lua
@@ -8,7 +8,7 @@ local clear = helpers.clear
local function test_embed(ext_linegrid)
local screen
local function startup(...)
- clear{headless=false, args={...}}
+ clear{args_rm={'--headless'}, args={...}}
-- attach immediately after startup, for early UI
screen = Screen.new(60, 8)
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index efa776762b..697ddc1887 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -529,7 +529,7 @@ describe('ui/ext_messages', function()
local screen
before_each(function()
- clear{headless=false, args={"--cmd", "set shortmess-=I"}}
+ clear{args_rm={'--headless'}, args={"--cmd", "set shortmess-=I"}}
screen = Screen.new(80, 24)
screen:attach({rgb=true, ext_messages=true, ext_popupmenu=true})
screen:set_default_attr_ids({
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua
index c54d608ec4..c5a23e4661 100644
--- a/test/functional/ui/multigrid_spec.lua
+++ b/test/functional/ui/multigrid_spec.lua
@@ -11,7 +11,7 @@ describe('ext_multigrid', function()
local screen
before_each(function()
- clear{headless=false, args={'--cmd', 'set laststatus=2'}}
+ clear{args_rm={'--headless'}, args={'--cmd', 'set laststatus=2'}}
screen = Screen.new(53,14)
screen:attach({ext_multigrid=true})
screen:set_default_attr_ids({
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index ed630259be..7ce21f5d76 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -115,7 +115,8 @@ describe('ui receives option updates', function()
end)
local function startup_test(headless)
- local expected = reset(nil,{headless=headless,args={'--cmd', 'set guifont=Comic\\ Sans\\ 12'}})
+ local expected = reset(nil, {args_rm=(headless and {} or {'--headless'}),
+ args={'--cmd', 'set guifont=Comic\\ Sans\\ 12'}})
expected.guifont = "Comic Sans 12"
screen:expect(function()
eq(expected, screen.options)