aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/options_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-07 10:16:00 +0800
committerGitHub <noreply@github.com>2023-12-07 10:16:00 +0800
commit6c3ddd8c510a28d4acb777b9676a0d4137b309fa (patch)
tree81ebbe3f39bce37a69968cce0be25d43fa77a827 /test/functional/ui/options_spec.lua
parent3198598e6974ae2009e816aeb96462cdfc3c59e9 (diff)
downloadrneovim-6c3ddd8c510a28d4acb777b9676a0d4137b309fa.tar.gz
rneovim-6c3ddd8c510a28d4acb777b9676a0d4137b309fa.tar.bz2
rneovim-6c3ddd8c510a28d4acb777b9676a0d4137b309fa.zip
test: set 'termguicolors' in outer Nvim instance (#26437)
Currently, the value of $COLORTERM in :terminal in tests depends on outer environment because of 'notermguicolors'. If $COLORTERM is not set in :terminal, an inner Nvim instance will try to detect 'termguicolors' support, which may interfere with tests. So set 'termguicolors' in outer Nvim instance unless $COLORTERM needs to be overridden, and unset it in inner Nvim instance when running TUI.
Diffstat (limited to 'test/functional/ui/options_spec.lua')
-rw-r--r--test/functional/ui/options_spec.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 2c649709c6..4c197ad5b9 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -9,7 +9,7 @@ local eval = helpers.eval
describe('UI receives option updates', function()
local screen
- local function reset(opts, ...)
+ local function reset(screen_opts, clear_opts)
local defaults = {
ambiwidth='single',
arabicshape=true,
@@ -38,9 +38,12 @@ describe('UI receives option updates', function()
ext_termcolors=false,
}
- clear(...)
+ clear_opts = shallowcopy(clear_opts or {})
+ clear_opts.args_rm = clear_opts.args_rm or {}
+ table.insert(clear_opts.args_rm or {}, '--cmd')
+ clear(clear_opts)
screen = Screen.new(20,5)
- screen:attach(opts)
+ screen:attach(screen_opts)
-- NB: UI test suite can be run in both "linegrid" and legacy grid mode.
-- In both cases check that the received value is the one requested.
defaults.ext_linegrid = screen._options.ext_linegrid or false