tests: don't ignore highlights in various tests

This commit is contained in:
Björn Linse 2016-08-09 15:11:04 +02:00
parent 0a882b4818
commit f282b8ecac
8 changed files with 101 additions and 95 deletions

View File

@ -213,22 +213,22 @@ describe('vim_* functions', function()
screen = Screen.new(40, 8)
screen:attach()
screen:set_default_attr_ids({
[0] = {bold=true, foreground=Screen.colors.Blue},
[1] = {foreground = Screen.colors.White, background = Screen.colors.Red},
[2] = {bold = true, foreground = Screen.colors.SeaGreen}
})
screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
end)
it('can show one line', function()
nvim_async('err_write', 'has bork\n')
screen:expect([[
^ |
~ |
~ |
~ |
~ |
~ |
~ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{1:has bork} |
]])
end)
@ -236,11 +236,11 @@ describe('vim_* functions', function()
it('shows return prompt when more than &cmdheight lines', function()
nvim_async('err_write', 'something happened\nvery bad\n')
screen:expect([[
~ |
~ |
~ |
~ |
~ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{1:something happened} |
{1:very bad} |
{2:Press ENTER or type command to continue}^ |
@ -250,9 +250,9 @@ describe('vim_* functions', function()
it('shows return prompt after all lines are shown', function()
nvim_async('err_write', 'FAILURE\nERROR\nEXCEPTION\nTRACEBACK\n')
screen:expect([[
~ |
~ |
~ |
{0:~ }|
{0:~ }|
{0:~ }|
{1:FAILURE} |
{1:ERROR} |
{1:EXCEPTION} |
@ -267,12 +267,12 @@ describe('vim_* functions', function()
nvim_async('err_write', 'fail\n')
screen:expect([[
^ |
~ |
~ |
~ |
~ |
~ |
~ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{1:very fail} |
]])
helpers.wait()
@ -280,11 +280,11 @@ describe('vim_* functions', function()
-- shows up to &cmdheight lines
nvim_async('err_write', 'more fail\ntoo fail\n')
screen:expect([[
~ |
~ |
~ |
~ |
~ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{1:more fail} |
{1:too fail} |
{2:Press ENTER or type command to continue}^ |

View File

@ -72,13 +72,13 @@ describe('execute()', function()
it('silences command run inside', function()
local screen = Screen.new(20, 5)
screen:attach()
screen:set_default_attr_ignore({{bold=true, foreground=255}})
screen:set_default_attr_ids( {[0] = {bold=true, foreground=255}} )
feed(':let g:mes = execute("echon 42")<CR>')
screen:expect([[
^ |
~ |
~ |
~ |
{0:~ }|
{0:~ }|
{0:~ }|
|
]])
eq('42', eval('g:mes'))

View File

@ -137,7 +137,7 @@ describe('timers', function()
it("doesn't mess up the cmdline", function()
local screen = Screen.new(40, 6)
screen:attach()
screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}})
screen:set_default_attr_ids( {[0] = {bold=true, foreground=255}} )
source([[
func! MyHandler(timer)
echo "evil"
@ -148,10 +148,10 @@ describe('timers', function()
screen:sleep(200)
screen:expect([[
|
~ |
~ |
~ |
~ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
:good^ |
]])
end)

View File

@ -9,8 +9,8 @@ describe(":drop", function()
clear()
screen = Screen.new(35, 10)
screen:attach()
screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}})
screen:set_default_attr_ids({
[0] = {bold=true, foreground=Screen.colors.Blue},
[1] = {bold = true, reverse = true},
[2] = {reverse = true},
[3] = {bold = true},
@ -26,13 +26,13 @@ describe(":drop", function()
execute("drop tmp1.vim")
screen:expect([[
^ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{0:~ }|
{1:tmp1.vim }|
"tmp1.vim" [New File] |
]])
@ -45,13 +45,13 @@ describe(":drop", function()
execute("drop tmp1")
screen:expect([[
{2:|}^ |
~ {2:|}~ |
~ {2:|}~ |
~ {2:|}~ |
~ {2:|}~ |
~ {2:|}~ |
~ {2:|}~ |
~ {2:|}~ |
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{2:tmp2 }{1:tmp1 }|
:drop tmp1 |
]])
@ -65,13 +65,13 @@ describe(":drop", function()
execute("drop tmp3")
screen:expect([[
^ {2:|} |
~ {2:|}~ |
~ {2:|}~ |
~ {2:|}~ |
{1:tmp3 }{2:|}~ |
ABC {2:|}~ |
~ {2:|}~ |
~ {2:|}~ |
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{1:tmp3 }{2:|}{0:~ }|
ABC {2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{0:~ }{2:|}{0:~ }|
{2:tmp2 [+] tmp1 }|
"tmp3" [New File] |
]])

View File

@ -248,14 +248,13 @@ describe('packadd', function()
screen = Screen.new(30, 5)
screen:attach()
screen:set_default_attr_ids({
[0] = {bold=true, foreground=Screen.colors.Blue},
[1] = {
foreground = Screen.colors.Black,
background = Screen.colors.Yellow,
},
[2] = {bold = true, reverse = true}
})
local NonText = Screen.colors.Blue
screen:set_default_attr_ignore({{}, {bold=true, foreground=NonText}})
execute([[let optdir1 = &packpath . '/pack/mine/opt']])
execute([[let optdir2 = &packpath . '/pack/candidate/opt']])
@ -269,32 +268,32 @@ describe('packadd', function()
feed(':packadd <Tab>')
screen:expect([=[
|
~ |
~ |
{0:~ }|
{0:~ }|
{1:pluginA}{2: pluginB pluginC }|
:packadd pluginA^ |
]=])
feed('<Tab>')
screen:expect([=[
|
~ |
~ |
{0:~ }|
{0:~ }|
{2:pluginA }{1:pluginB}{2: pluginC }|
:packadd pluginB^ |
]=])
feed('<Tab>')
screen:expect([=[
|
~ |
~ |
{0:~ }|
{0:~ }|
{2:pluginA pluginB }{1:pluginC}{2: }|
:packadd pluginC^ |
]=])
feed('<Tab>')
screen:expect([=[
|
~ |
~ |
{0:~ }|
{0:~ }|
{2:pluginA pluginB pluginC }|
:packadd ^ |
]=])
@ -316,32 +315,32 @@ describe('packadd', function()
feed(':colorscheme <Tab>')
screen:expect([=[
|
~ |
~ |
{0:~ }|
{0:~ }|
{1:one}{2: three two }|
:colorscheme one^ |
]=])
feed('<Tab>')
screen:expect([=[
|
~ |
~ |
{0:~ }|
{0:~ }|
{2:one }{1:three}{2: two }|
:colorscheme three^ |
]=])
feed('<Tab>')
screen:expect([=[
|
~ |
~ |
{0:~ }|
{0:~ }|
{2:one three }{1:two}{2: }|
:colorscheme two^ |
]=])
feed('<Tab>')
screen:expect([=[
|
~ |
~ |
{0:~ }|
{0:~ }|
{2:one three two }|
:colorscheme ^ |
]=])

View File

@ -16,7 +16,10 @@ describe('matchparen', function()
reset()
screen = Screen.new(20,5)
screen:attach()
screen:set_default_attr_ignore( {{bold=true, foreground=Screen.colors.Blue}} )
screen:set_default_attr_ids( {
[0] = {bold=true, foreground=255},
[1] = {bold=true},
} )
end)
it('uses correct column after i_<Up>. Vim patch 7.4.1296', function()
@ -37,7 +40,7 @@ describe('matchparen', function()
^ |
} |
{1:-- INSERT --} |
]], {[1] = {bold = true}})
]])
end)
end)

View File

@ -9,7 +9,11 @@ describe('Signs', function()
clear()
screen = Screen.new()
screen:attach()
screen:set_default_attr_ignore( {{}, {bold=true, foreground=255}} )
screen:set_default_attr_ids( {
[0] = {bold=true, foreground=255},
[1] = {background = Screen.colors.Yellow},
[2] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Grey},
} )
end)
after_each(function()
@ -25,19 +29,19 @@ describe('Signs', function()
execute('sign place 2 line=3 name=piet buffer=1')
execute('sign place 3 line=1 name=pietx buffer=1')
screen:expect([[
>!a |
b |
>>c |
^ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
{1:>!}a |
{2: }b |
{1:>>}c |
{2: }^ |
{2: }{0:~ }|
{2: }{0:~ }|
{2: }{0:~ }|
{2: }{0:~ }|
{2: }{0:~ }|
{2: }{0:~ }|
{2: }{0:~ }|
{2: }{0:~ }|
{2: }{0:~ }|
:sign place 3 line=1 name=pietx buffer=1 |
]])
end)

View File

@ -39,7 +39,7 @@ describe('command line completion', function()
clear()
screen = Screen.new(40, 5)
screen:attach()
screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}})
screen:set_default_attr_ids({[1]={bold=true, foreground=Screen.colors.Blue}})
end)
after_each(function()
@ -55,9 +55,9 @@ describe('command line completion', function()
feed(':!<tab><bs>')
screen:expect([[
|
~ |
~ |
~ |
{1:~ }|
{1:~ }|
{1:~ }|
:!Xtest-functional-viml-compl-dir^ |
]])
end)