test: Screen also checks 'special' when testing attribute equality

This commit is contained in:
AdnoC
2016-05-17 16:25:11 -04:00
parent 954aeafa89
commit e5eea7fa06
3 changed files with 15 additions and 13 deletions

View File

@@ -25,7 +25,7 @@ describe('terminal window highlighting', function()
[5] = {background = 11},
[6] = {foreground = 130},
[7] = {reverse = true},
[8] = {background = 11}
[8] = {background = 11},
})
screen:attach(false)
execute('enew | call termopen(["'..nvim_dir..'/tty-test"]) | startinsert')
@@ -121,7 +121,7 @@ describe('terminal window highlighting with custom palette', function()
clear()
screen = Screen.new(50, 7)
screen:set_default_attr_ids({
[1] = {foreground = 1193046}
[1] = {foreground = 1193046, special = Screen.colors.Black}
})
screen:set_default_attr_ignore({
[1] = {bold = true},
@@ -130,7 +130,7 @@ describe('terminal window highlighting with custom palette', function()
[5] = {background = 11},
[6] = {foreground = 130},
[7] = {reverse = true},
[8] = {background = 11}
[8] = {background = 11},
})
screen:attach(true)
nvim('set_var', 'terminal_color_3', '#123456')

View File

@@ -312,11 +312,12 @@ describe('New special highlight color attribute', function()
screen = Screen.new(25,10)
screen:attach()
screen:set_default_attr_ignore({
{bold=true, foreground=Screen.colors.Blue}
[1] = {bold = true, foreground = Screen.colors.Blue},
[2] = {bold = true}
})
end)
it('used for undercurls', function()
it('can be set and is applied like foreground or background', function()
execute('syntax on')
execute('syn keyword TmpKeyword neovim')
execute('syn keyword TmpKeyword1 special')
@@ -343,19 +344,19 @@ describe('New special highlight color attribute', function()
{1:neovim} |
awesome {1:neovim} |
wordcontainingneovim |
special |
{2:specialwithbg} |
{3:specialwithfg} |
{2:special} |
{3:specialwithbg} |
{4:specialwithfg} |
|
{1:neovim} tabbed^ |
~ |
{4:-- INSERT --} |
-- INSERT -- |
]],{
[1] = {background = Screen.colors.Yellow, foreground = Screen.colors.Red,
special = Screen.colors.Red},
[2] = {special = Screen.colors.Red, background = Screen.colors.Yellow},
[3] = {foreground = Screen.colors.Red, special = Screen.colors.Red},
[4] = {bold = true}
[2] = {special = Screen.colors.Red},
[3] = {special = Screen.colors.Red, background = Screen.colors.Yellow},
[4] = {foreground = Screen.colors.Red, special = Screen.colors.Red},
})
end)

View File

@@ -618,7 +618,8 @@ function Screen:_equal_attrs(a, b)
a.underline == b.underline and a.undercurl == b.undercurl and
a.italic == b.italic and a.reverse == b.reverse and
a.foreground == b.foreground and
a.background == b.background
a.background == b.background and
a.special == b.special
end
function Screen:_attr_index(attrs, attr)