aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/highlight_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-08-09 17:01:56 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2016-08-14 21:53:02 +0200
commitf332eba16c290c729b21171ed83b1e3377ee17ec (patch)
tree8b23785f0858fabdc9fcb87bff80d8bb80955514 /test/functional/terminal/highlight_spec.lua
parent4de10d43aa735460eef0e5786a868a1be9431298 (diff)
downloadrneovim-f332eba16c290c729b21171ed83b1e3377ee17ec.tar.gz
rneovim-f332eba16c290c729b21171ed83b1e3377ee17ec.tar.bz2
rneovim-f332eba16c290c729b21171ed83b1e3377ee17ec.zip
tests: don't ignore highlights in terminal tests
Diffstat (limited to 'test/functional/terminal/highlight_spec.lua')
-rw-r--r--test/functional/terminal/highlight_spec.lua55
1 files changed, 25 insertions, 30 deletions
diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua
index 8d7c7451d3..95fbf2c871 100644
--- a/test/functional/terminal/highlight_spec.lua
+++ b/test/functional/terminal/highlight_spec.lua
@@ -16,33 +16,32 @@ describe('terminal window highlighting', function()
[1] = {foreground = 45},
[2] = {background = 46},
[3] = {foreground = 45, background = 46},
- [4] = {bold = true, italic = true, underline = true}
- })
- screen:set_default_attr_ignore({
- [1] = {bold = true},
- [2] = {foreground = 12},
- [3] = {bold = true, reverse = true},
- [5] = {background = 11},
- [6] = {foreground = 130},
- [7] = {reverse = true},
+ [4] = {bold = true, italic = true, underline = true},
+ [5] = {bold = true},
+ [6] = {foreground = 12},
+ [7] = {bold = true, reverse = true},
[8] = {background = 11},
+ [9] = {foreground = 130},
+ [10] = {reverse = true},
+ [11] = {background = 11},
})
screen:attach(false)
execute('enew | call termopen(["'..nvim_dir..'/tty-test"]) | startinsert')
screen:expect([[
tty ready |
+ {10: } |
|
|
|
|
- |
- -- TERMINAL -- |
+ {5:-- TERMINAL --} |
]])
end)
local function descr(title, attr_num, set_attrs_fn)
local function sub(s)
- return s:gsub('NUM', attr_num)
+ local str = s:gsub('NUM', attr_num)
+ return str
end
describe(title, function()
@@ -54,16 +53,15 @@ describe('terminal window highlighting', function()
end)
local function pass_attrs()
- local s = sub([[
+ screen:expect(sub([[
tty ready |
- {NUM:text}text |
+ {NUM:text}text{10: } |
|
|
|
|
- -- TERMINAL -- |
- ]])
- screen:expect(s)
+ {5:-- TERMINAL --} |
+ ]]))
end
it('will pass the corresponding attributes', pass_attrs)
@@ -82,11 +80,11 @@ describe('terminal window highlighting', function()
line6 |
line7 |
line8 |
- |
- -- TERMINAL -- |
+ {10: } |
+ {5:-- TERMINAL --} |
]])
feed('<c-\\><c-n>gg')
- local s = sub([[
+ screen:expect(sub([[
^tty ready |
{NUM:text}textline1 |
line2 |
@@ -94,8 +92,7 @@ describe('terminal window highlighting', function()
line4 |
line5 |
|
- ]])
- screen:expect(s)
+ ]]))
end)
end)
end
@@ -121,28 +118,26 @@ describe('terminal window highlighting with custom palette', function()
clear()
screen = Screen.new(50, 7)
screen:set_default_attr_ids({
- [1] = {foreground = 1193046, special = Screen.colors.Black}
- })
- screen:set_default_attr_ignore({
- [1] = {bold = true},
+ [1] = {foreground = 1193046, special = Screen.colors.Black},
[2] = {foreground = 12},
[3] = {bold = true, reverse = true},
[5] = {background = 11},
[6] = {foreground = 130},
[7] = {reverse = true},
[8] = {background = 11},
+ [9] = {bold = true},
})
screen:attach(true)
nvim('set_var', 'terminal_color_3', '#123456')
execute('enew | call termopen(["'..nvim_dir..'/tty-test"]) | startinsert')
screen:expect([[
tty ready |
+ {7: } |
|
|
|
|
- |
- -- TERMINAL -- |
+ {9:-- TERMINAL --} |
]])
end)
@@ -153,12 +148,12 @@ describe('terminal window highlighting with custom palette', function()
thelpers.feed_data('text')
screen:expect([[
tty ready |
- {1:text}text |
+ {1:text}text{7: } |
|
|
|
|
- -- TERMINAL -- |
+ {9:-- TERMINAL --} |
]])
end)
end)