refactor(tests): use global defaults instead of set_default_attr_ids (2)

This commit is contained in:
bfredl
2024-03-27 10:35:50 +01:00
parent 63f7b1f31e
commit b556bd1a53
30 changed files with 580 additions and 857 deletions

View File

@@ -12,10 +12,6 @@ describe('063: Test for ":match", "matchadd()" and related functions', function(
it('is working', function()
local screen = Screen.new(40, 5)
screen:attach()
screen:set_default_attr_ids({
[0] = { bold = true, foreground = Screen.colors.Blue },
[1] = { background = Screen.colors.Red },
})
command('highlight MyGroup1 term=bold ctermbg=red guibg=red')
command('highlight MyGroup2 term=italic ctermbg=green guibg=green')
@@ -25,8 +21,8 @@ describe('063: Test for ":match", "matchadd()" and related functions', function(
insert('abcdefghijklmnopq')
command("call matchaddpos('MyGroup1', [[1, 5], [1, 8, 3]], 10, 3)")
screen:expect([[
abcd{1:e}fg{1:hij}klmnop^q |
{0:~ }|*3
abcd{30:e}fg{30:hij}klmnop^q |
{1:~ }|*3
|
]])
@@ -34,8 +30,8 @@ describe('063: Test for ":match", "matchadd()" and related functions', function(
command("call setline(1, 'abcdΣabcdef')")
command("call matchaddpos('MyGroup1', [[1, 4, 2], [1, 9, 2]])")
screen:expect([[
abc{1:dΣ}ab{1:cd}e^f |
{0:~ }|*3
abc{30:dΣ}ab{30:cd}e^f |
{1:~ }|*3
|
]])
end)