aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/float_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-11-27 10:33:54 +0100
committerbfredl <bjorn.linse@gmail.com>2022-11-27 11:51:10 +0100
commit942f26279d373fcdebcb41363e526a2871b09a71 (patch)
tree97660b67740882f34d3568531475b9b5a2098182 /test/functional/ui/float_spec.lua
parent3098064f332ffbc59c342545402e2d2da798a458 (diff)
downloadrneovim-942f26279d373fcdebcb41363e526a2871b09a71.tar.gz
rneovim-942f26279d373fcdebcb41363e526a2871b09a71.tar.bz2
rneovim-942f26279d373fcdebcb41363e526a2871b09a71.zip
fix(tests): only get the color map once, even for multiple test files
Problem: test/functional/ui/screen.lua would be reloaded for each *_spec.lua file, which causes an extra nvim session to be started to get the color map each time. solution: Mark screen.lua as a preloaded file, but defer the loading of the color map to the first time Screen object is initialised.
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r--test/functional/ui/float_spec.lua62
1 files changed, 31 insertions, 31 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua
index c7ee4ee87d..bc05d9081d 100644
--- a/test/functional/ui/float_spec.lua
+++ b/test/functional/ui/float_spec.lua
@@ -25,36 +25,6 @@ describe('float window', function()
clear()
command('hi VertSplit gui=reverse')
end)
- local attrs = {
- [0] = {bold=true, foreground=Screen.colors.Blue},
- [1] = {background = Screen.colors.LightMagenta},
- [2] = {background = Screen.colors.LightMagenta, bold = true, foreground = Screen.colors.Blue1},
- [3] = {bold = true},
- [4] = {bold = true, reverse = true},
- [5] = {reverse = true},
- [6] = {background = Screen.colors.LightMagenta, bold = true, reverse = true},
- [7] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
- [8] = {bold = true, foreground = Screen.colors.SeaGreen4},
- [9] = {background = Screen.colors.LightGrey, underline = true},
- [10] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Magenta},
- [11] = {bold = true, foreground = Screen.colors.Magenta},
- [12] = {background = Screen.colors.Red, bold = true, foreground = Screen.colors.Blue1},
- [13] = {background = Screen.colors.WebGray},
- [14] = {foreground = Screen.colors.Brown},
- [15] = {background = Screen.colors.Grey20},
- [16] = {background = Screen.colors.Grey20, bold = true, foreground = Screen.colors.Blue1},
- [17] = {background = Screen.colors.Yellow},
- [18] = {foreground = Screen.colors.Brown, background = Screen.colors.Grey20},
- [19] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray},
- [20] = {bold = true, foreground = Screen.colors.Brown},
- [21] = {background = Screen.colors.Gray90},
- [22] = {background = Screen.colors.LightRed},
- [23] = {foreground = Screen.colors.Black, background = Screen.colors.White};
- [24] = {foreground = Screen.colors.Black, background = Screen.colors.Grey80};
- [25] = {blend = 100, background = Screen.colors.Gray0};
- [26] = {blend = 80, background = Screen.colors.Gray0};
- [27] = {background = Screen.colors.LightGray};
- }
it('behavior', function()
-- Create three windows and test that ":wincmd <direction>" changes to the
@@ -724,10 +694,40 @@ describe('float window', function()
end)
local function with_ext_multigrid(multigrid)
- local screen
+ local screen, attrs
before_each(function()
screen = Screen.new(40,7)
screen:attach {ext_multigrid=multigrid}
+ attrs = {
+ [0] = {bold=true, foreground=Screen.colors.Blue},
+ [1] = {background = Screen.colors.LightMagenta},
+ [2] = {background = Screen.colors.LightMagenta, bold = true, foreground = Screen.colors.Blue1},
+ [3] = {bold = true},
+ [4] = {bold = true, reverse = true},
+ [5] = {reverse = true},
+ [6] = {background = Screen.colors.LightMagenta, bold = true, reverse = true},
+ [7] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
+ [8] = {bold = true, foreground = Screen.colors.SeaGreen4},
+ [9] = {background = Screen.colors.LightGrey, underline = true},
+ [10] = {background = Screen.colors.LightGrey, underline = true, bold = true, foreground = Screen.colors.Magenta},
+ [11] = {bold = true, foreground = Screen.colors.Magenta},
+ [12] = {background = Screen.colors.Red, bold = true, foreground = Screen.colors.Blue1},
+ [13] = {background = Screen.colors.WebGray},
+ [14] = {foreground = Screen.colors.Brown},
+ [15] = {background = Screen.colors.Grey20},
+ [16] = {background = Screen.colors.Grey20, bold = true, foreground = Screen.colors.Blue1},
+ [17] = {background = Screen.colors.Yellow},
+ [18] = {foreground = Screen.colors.Brown, background = Screen.colors.Grey20},
+ [19] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.WebGray},
+ [20] = {bold = true, foreground = Screen.colors.Brown},
+ [21] = {background = Screen.colors.Gray90},
+ [22] = {background = Screen.colors.LightRed},
+ [23] = {foreground = Screen.colors.Black, background = Screen.colors.White};
+ [24] = {foreground = Screen.colors.Black, background = Screen.colors.Grey80};
+ [25] = {blend = 100, background = Screen.colors.Gray0};
+ [26] = {blend = 80, background = Screen.colors.Gray0};
+ [27] = {background = Screen.colors.LightGray};
+ }
screen:set_default_attr_ids(attrs)
end)