aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/options_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-07-18 19:37:18 +0000
committerJosh Rahm <rahm@google.com>2022-07-18 19:37:18 +0000
commit308e1940dcd64aa6c344c403d4f9e0dda58d9c5c (patch)
tree35fe43e01755e0f312650667004487a44d6b7941 /test/functional/ui/options_spec.lua
parent96a00c7c588b2f38a2424aeeb4ea3581d370bf2d (diff)
parente8c94697bcbe23a5c7b07c292b90a6b70aadfa87 (diff)
downloadrneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.gz
rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.tar.bz2
rneovim-308e1940dcd64aa6c344c403d4f9e0dda58d9c5c.zip
Merge remote-tracking branch 'upstream/master' into rahm
Diffstat (limited to 'test/functional/ui/options_spec.lua')
-rw-r--r--test/functional/ui/options_spec.lua57
1 files changed, 52 insertions, 5 deletions
diff --git a/test/functional/ui/options_spec.lua b/test/functional/ui/options_spec.lua
index 2f113f6ac6..c2b0bcdb64 100644
--- a/test/functional/ui/options_spec.lua
+++ b/test/functional/ui/options_spec.lua
@@ -4,6 +4,7 @@ local clear = helpers.clear
local command = helpers.command
local eq = helpers.eq
local shallowcopy = helpers.shallowcopy
+local eval = helpers.eval
describe('UI receives option updates', function()
local screen
@@ -62,17 +63,18 @@ describe('UI receives option updates', function()
end
screen:attach()
screen:expect(function()
- eq({'mouse_off'}, evs)
+ eq({'mouse_on'}, evs)
end)
- command("set mouse=nvi")
+ command("set mouse=")
+ command("set mouse&")
screen:expect(function()
- eq({'mouse_off','mouse_on'}, evs)
+ eq({'mouse_on','mouse_off', 'mouse_on'}, evs)
end)
screen:detach()
- eq({'mouse_off','mouse_on'}, evs)
+ eq({'mouse_on','mouse_off', 'mouse_on'}, evs)
screen:attach()
screen:expect(function()
- eq({'mouse_off','mouse_on','mouse_on'}, evs)
+ eq({'mouse_on','mouse_off','mouse_on', 'mouse_on'}, evs)
end)
end)
@@ -86,6 +88,12 @@ describe('UI receives option updates', function()
eq(expected, screen.options)
end)
+ command("set pumblend=-1")
+ expected.pumblend = 0
+ screen:expect(function()
+ eq(expected, screen.options)
+ end)
+
command("set guifont=Comic\\ Sans")
expected.guifont = "Comic Sans"
screen:expect(function()
@@ -168,3 +176,42 @@ describe('UI receives option updates', function()
it('from startup options with --headless', function() startup_test(true) end)
it('from startup options with --embed', function() startup_test(false) end)
end)
+
+describe('UI can set terminal option', function()
+ local screen
+ before_each(function()
+ -- by default we implicity "--cmd 'set bg=light'" which ruins everything
+ clear{args_rm={'--cmd'}}
+ screen = Screen.new(20,5)
+ end)
+
+ it('term_background', function()
+ eq('dark', eval '&background')
+
+ screen:attach {term_background='light'}
+ eq('light', eval '&background')
+ end)
+
+ it("term_background but not if 'background' already set by user", function()
+ eq('dark', eval '&background')
+ command 'set background=dark'
+
+ screen:attach {term_background='light'}
+
+ eq('dark', eval '&background')
+ end)
+
+ it('term_name', function()
+ eq('nvim', eval '&term')
+
+ screen:attach {term_name='xterm'}
+ eq('xterm', eval '&term')
+ end)
+
+ it('term_colors', function()
+ eq('256', eval '&t_Co')
+
+ screen:attach {term_colors=8}
+ eq('8', eval '&t_Co')
+ end)
+end)