aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/health_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-11-11 22:15:19 +0100
committerbfredl <bjorn.linse@gmail.com>2024-11-14 12:40:57 +0100
commite61228a214ebda9845db9462dad0a8c362d3963f (patch)
treefc5908c85c0cc6affc3bc325cd75f6efaeea95d8 /test/functional/plugin/health_spec.lua
parent40dee8a2dcba996badaa6182eb34fde1694f92a3 (diff)
downloadrneovim-e61228a214ebda9845db9462dad0a8c362d3963f.tar.gz
rneovim-e61228a214ebda9845db9462dad0a8c362d3963f.tar.bz2
rneovim-e61228a214ebda9845db9462dad0a8c362d3963f.zip
fix(tests): needing two calls to setup a screen is cringe
Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
Diffstat (limited to 'test/functional/plugin/health_spec.lua')
-rw-r--r--test/functional/plugin/health_spec.lua10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/functional/plugin/health_spec.lua b/test/functional/plugin/health_spec.lua
index 7089313303..753da64522 100644
--- a/test/functional/plugin/health_spec.lua
+++ b/test/functional/plugin/health_spec.lua
@@ -155,7 +155,6 @@ describe('vim.health', function()
it('highlights OK, ERROR', function()
local screen = Screen.new(50, 12)
- screen:attach()
screen:set_default_attr_ids({
h1 = { reverse = true },
h2 = { foreground = tonumber('0x6a0dad') },
@@ -222,7 +221,7 @@ describe(':checkhealth window', function()
end)
it('opens directly if no buffer created', function()
- local screen = Screen.new(50, 12)
+ local screen = Screen.new(50, 12, { ext_multigrid = true })
screen:set_default_attr_ids {
h1 = { reverse = true },
h2 = { foreground = tonumber('0x6a0dad') },
@@ -230,7 +229,6 @@ describe(':checkhealth window', function()
[14] = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray },
[32] = { foreground = Screen.colors.PaleGreen2 },
}
- screen:attach({ ext_multigrid = true })
command('checkhealth success1')
screen:expect {
grid = [[
@@ -256,7 +254,7 @@ describe(':checkhealth window', function()
end)
local function test_health_vsplit(left, emptybuf, mods)
- local screen = Screen.new(50, 20)
+ local screen = Screen.new(50, 20, { ext_multigrid = true })
screen:set_default_attr_ids {
h1 = { reverse = true },
h2 = { foreground = tonumber('0x6a0dad') },
@@ -264,7 +262,6 @@ describe(':checkhealth window', function()
[14] = { foreground = Screen.colors.LightGrey, background = Screen.colors.DarkGray },
[32] = { foreground = Screen.colors.PaleGreen2 },
}
- screen:attach({ ext_multigrid = true })
if not emptybuf then
insert('hello')
end
@@ -322,8 +319,7 @@ describe(':checkhealth window', function()
end
local function test_health_split(top, emptybuf, mods)
- local screen = Screen.new(50, 25)
- screen:attach({ ext_multigrid = true })
+ local screen = Screen.new(50, 25, { ext_multigrid = true })
screen._default_attr_ids = nil
if not emptybuf then
insert('hello')