From fa74f7571094dba15a7e8e216beef11786cff203 Mon Sep 17 00:00:00 2001 From: bfredl Date: Tue, 2 Apr 2024 11:46:48 +0200 Subject: 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. --- test/functional/ui/popupmenu_spec.lua | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'test/functional/ui/popupmenu_spec.lua') 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') - 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 -- cgit