aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnoC <adam.r.cutler@gmail.com>2016-05-17 16:25:11 -0400
committerAdnoC <adam.r.cutler@gmail.com>2016-05-17 16:36:41 -0400
commite5eea7fa06ae7057521755d1f638d34e049bd379 (patch)
treee7e2241ef36f792e143e6da45ef85a6033689a31
parent954aeafa8999d4b3ea9cc9f823457a223e086863 (diff)
downloadrneovim-e5eea7fa06ae7057521755d1f638d34e049bd379.tar.gz
rneovim-e5eea7fa06ae7057521755d1f638d34e049bd379.tar.bz2
rneovim-e5eea7fa06ae7057521755d1f638d34e049bd379.zip
test: Screen also checks 'special' when testing attribute equality
-rw-r--r--test/functional/terminal/highlight_spec.lua6
-rw-r--r--test/functional/ui/highlight_spec.lua19
-rw-r--r--test/functional/ui/screen.lua3
3 files changed, 15 insertions, 13 deletions
diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua
index 045f5aa42f..97875c5147 100644
--- a/test/functional/terminal/highlight_spec.lua
+++ b/test/functional/terminal/highlight_spec.lua
@@ -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')
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index c46dd59ada..c773836c6e 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -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)
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 11fde34ffc..6372cbe081 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -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)