aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/popupmenu_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-04-02 11:46:48 +0200
committerbfredl <bjorn.linse@gmail.com>2024-04-02 20:28:27 +0200
commitfa74f7571094dba15a7e8e216beef11786cff203 (patch)
tree17ee9c993ed43a8c5b340ed27454fff3ae8dfd20 /test/functional/ui/popupmenu_spec.lua
parentd9235efa76229708586d3c9db3dcbac46127ca0a (diff)
downloadrneovim-fa74f7571094dba15a7e8e216beef11786cff203.tar.gz
rneovim-fa74f7571094dba15a7e8e216beef11786cff203.tar.bz2
rneovim-fa74f7571094dba15a7e8e216beef11786cff203.zip
refactor(tests): allow to extend the new base set of attrs
We start at 100 so we can make the base set larger if needed. (It might need to grow/shrink as a result of adopting the new default color scheme as the default for tests) Usage best illustrataded by example. Improving the workflow for making new tests with `screen:snapshot_util()` will be a follow up.
Diffstat (limited to 'test/functional/ui/popupmenu_spec.lua')
-rw-r--r--test/functional/ui/popupmenu_spec.lua16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index 1f0d20f66d..10d933f00a 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -1171,6 +1171,10 @@ describe('builtin popupmenu', function()
[6] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
[7] = { background = Screen.colors.Yellow }, -- Search
[8] = { foreground = Screen.colors.Red },
+ kn = { foreground = Screen.colors.Red, background = Screen.colors.Magenta },
+ ks = { foreground = Screen.colors.Red, background = Screen.colors.Grey },
+ xn = { foreground = Screen.colors.White, background = Screen.colors.Magenta },
+ xs = { foreground = Screen.colors.Black, background = Screen.colors.Grey },
})
screen:attach({ ext_multigrid = multigrid })
end)
@@ -4477,23 +4481,15 @@ describe('builtin popupmenu', function()
hi PmenuExtra guifg=White guibg=Magenta
hi PmenuExtraSel guifg=Black guibg=Grey
]])
- local attrs = screen:get_default_attr_ids()
- attrs.kn = { foreground = Screen.colors.Red, background = Screen.colors.Magenta }
- attrs.ks = { foreground = Screen.colors.Red, background = Screen.colors.Grey }
- attrs.xn = { foreground = Screen.colors.White, background = Screen.colors.Magenta }
- attrs.xs = { foreground = Screen.colors.Black, background = Screen.colors.Grey }
feed('iaw<C-X><C-u>')
- screen:expect(
- [[
+ screen:expect([[
aword1^ |
{s:aword1 }{ks:W }{xs:extra text 1 }{1: }|
{n:aword2 }{kn:W }{xn:extra text 2 }{1: }|
{n:aword3 }{kn:W }{xn:extra text 3 }{1: }|
{1:~ }|*3
{2:-- }{5:match 1 of 3} |
- ]],
- attrs
- )
+ ]])
end)
end)
end