mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #29014 from bfredl/editortest
refactor(tests): more global highlight definitions
This commit is contained in:
commit
4f24e1b1d7
@ -276,11 +276,6 @@ describe('fileio', function()
|
|||||||
write_file('Xtest-overwrite-forced', 'foobar')
|
write_file('Xtest-overwrite-forced', 'foobar')
|
||||||
command('set nofixendofline')
|
command('set nofixendofline')
|
||||||
local screen = Screen.new(40, 4)
|
local screen = Screen.new(40, 4)
|
||||||
screen:set_default_attr_ids({
|
|
||||||
[1] = { bold = true, foreground = Screen.colors.Blue1 },
|
|
||||||
[2] = { foreground = Screen.colors.Grey100, background = Screen.colors.Red },
|
|
||||||
[3] = { bold = true, foreground = Screen.colors.SeaGreen4 },
|
|
||||||
})
|
|
||||||
screen:attach()
|
screen:attach()
|
||||||
command('set shortmess-=F')
|
command('set shortmess-=F')
|
||||||
|
|
||||||
@ -300,9 +295,9 @@ describe('fileio', function()
|
|||||||
-- use async feed_command because nvim basically hangs on the prompt
|
-- use async feed_command because nvim basically hangs on the prompt
|
||||||
feed_command('w')
|
feed_command('w')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{2:WARNING: The file has been changed since}|
|
{9:WARNING: The file has been changed since}|
|
||||||
{2: reading it!!!} |
|
{9: reading it!!!} |
|
||||||
{3:Do you really want to write to it (y/n)?}|
|
{6:Do you really want to write to it (y/n)?}|
|
||||||
^ |
|
^ |
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
@ -910,11 +910,6 @@ describe('jobs', function()
|
|||||||
|
|
||||||
it('hides cursor and flushes messages before blocking', function()
|
it('hides cursor and flushes messages before blocking', function()
|
||||||
local screen = Screen.new(50, 6)
|
local screen = Screen.new(50, 6)
|
||||||
screen:set_default_attr_ids({
|
|
||||||
[0] = { foreground = Screen.colors.Blue, bold = true }, -- NonText
|
|
||||||
[1] = { bold = true, reverse = true }, -- MsgSeparator
|
|
||||||
[2] = { bold = true, foreground = Screen.colors.SeaGreen }, -- MoreMsg
|
|
||||||
})
|
|
||||||
screen:attach()
|
screen:attach()
|
||||||
command([[let g:id = jobstart([v:progpath, '--clean', '--headless'])]])
|
command([[let g:id = jobstart([v:progpath, '--clean', '--headless'])]])
|
||||||
source([[
|
source([[
|
||||||
@ -928,8 +923,8 @@ describe('jobs', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
|
|
|
|
||||||
{0:~ }|*2
|
{1:~ }|*2
|
||||||
{1: }|
|
{3: }|
|
||||||
aaa |
|
aaa |
|
||||||
bbb |
|
bbb |
|
||||||
]],
|
]],
|
||||||
@ -938,11 +933,11 @@ describe('jobs', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
|
|
|
|
||||||
{1: }|
|
{3: }|
|
||||||
aaa |
|
aaa |
|
||||||
bbb |
|
bbb |
|
||||||
ccc |
|
ccc |
|
||||||
{2:Press ENTER or type command to continue}^ |
|
{6:Press ENTER or type command to continue}^ |
|
||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
feed('<CR>')
|
feed('<CR>')
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -48,18 +48,14 @@ describe('cmdline', function()
|
|||||||
|
|
||||||
it('redraws statusline when toggling overstrike', function()
|
it('redraws statusline when toggling overstrike', function()
|
||||||
local screen = Screen.new(60, 4)
|
local screen = Screen.new(60, 4)
|
||||||
screen:set_default_attr_ids({
|
|
||||||
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
|
|
||||||
[1] = { reverse = true, bold = true }, -- StatusLine
|
|
||||||
})
|
|
||||||
screen:attach()
|
screen:attach()
|
||||||
command('set laststatus=2 statusline=%!mode(1)')
|
command('set laststatus=2 statusline=%!mode(1)')
|
||||||
feed(':')
|
feed(':')
|
||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
|
|
|
|
||||||
{0:~ }|
|
{1:~ }|
|
||||||
{1:c }|
|
{3:c }|
|
||||||
:^ |
|
:^ |
|
||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
@ -67,8 +63,8 @@ describe('cmdline', function()
|
|||||||
screen:expect {
|
screen:expect {
|
||||||
grid = [[
|
grid = [[
|
||||||
|
|
|
|
||||||
{0:~ }|
|
{1:~ }|
|
||||||
{1:cr }|
|
{3:cr }|
|
||||||
:^ |
|
:^ |
|
||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
|
@ -180,12 +180,6 @@ describe('insert-mode', function()
|
|||||||
|
|
||||||
it('multi-char mapping updates screen properly #25626', function()
|
it('multi-char mapping updates screen properly #25626', function()
|
||||||
local screen = Screen.new(60, 6)
|
local screen = Screen.new(60, 6)
|
||||||
screen:set_default_attr_ids({
|
|
||||||
[0] = { bold = true, foreground = Screen.colors.Blue }, -- NonText
|
|
||||||
[1] = { bold = true, reverse = true }, -- StatusLine
|
|
||||||
[2] = { reverse = true }, -- StatusLineNC
|
|
||||||
[3] = { bold = true }, -- ModeMsg
|
|
||||||
})
|
|
||||||
screen:attach()
|
screen:attach()
|
||||||
command('vnew')
|
command('vnew')
|
||||||
insert('foo\nfoo\nfoo')
|
insert('foo\nfoo\nfoo')
|
||||||
@ -197,10 +191,10 @@ describe('insert-mode', function()
|
|||||||
grid = [[
|
grid = [[
|
||||||
foo │ |
|
foo │ |
|
||||||
foo │β^jβ |
|
foo │β^jβ |
|
||||||
foo │{0:~ }|
|
foo │{1:~ }|
|
||||||
{0:~ }│{0:~ }|
|
{1:~ }│{1:~ }|
|
||||||
{2:[No Name] [+] }{1:[No Name] [+] }|
|
{2:[No Name] [+] }{3:[No Name] [+] }|
|
||||||
{3:-- INSERT --} |
|
{5:-- INSERT --} |
|
||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
feed('k')
|
feed('k')
|
||||||
@ -208,9 +202,9 @@ describe('insert-mode', function()
|
|||||||
grid = [[
|
grid = [[
|
||||||
foo │ |
|
foo │ |
|
||||||
foo │^βββ |
|
foo │^βββ |
|
||||||
foo │{0:~ }|
|
foo │{1:~ }|
|
||||||
{0:~ }│{0:~ }|
|
{1:~ }│{1:~ }|
|
||||||
{2:[No Name] [+] }{1:[No Name] [+] }|
|
{2:[No Name] [+] }{3:[No Name] [+] }|
|
||||||
|
|
|
|
||||||
]],
|
]],
|
||||||
}
|
}
|
||||||
|
@ -102,14 +102,9 @@ describe('tabpage', function()
|
|||||||
|
|
||||||
it('switching tabpage after setting laststatus=3 #19591', function()
|
it('switching tabpage after setting laststatus=3 #19591', function()
|
||||||
local screen = Screen.new(40, 8)
|
local screen = Screen.new(40, 8)
|
||||||
screen:set_default_attr_ids({
|
screen:add_extra_attr_ids {
|
||||||
[0] = { bold = true, foreground = Screen.colors.Blue },
|
[100] = { bold = true, foreground = Screen.colors.Fuchsia },
|
||||||
[1] = { bold = true, reverse = true }, -- StatusLine
|
}
|
||||||
[2] = { reverse = true }, -- TabLineFill
|
|
||||||
[3] = { bold = true }, -- TabLineSel
|
|
||||||
[4] = { background = Screen.colors.LightGrey, underline = true }, -- TabLine
|
|
||||||
[5] = { bold = true, foreground = Screen.colors.Magenta },
|
|
||||||
})
|
|
||||||
screen:attach()
|
screen:attach()
|
||||||
|
|
||||||
command('tabnew')
|
command('tabnew')
|
||||||
@ -118,18 +113,18 @@ describe('tabpage', function()
|
|||||||
command('tabnext')
|
command('tabnext')
|
||||||
feed('<C-G>')
|
feed('<C-G>')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{4: [No Name] }{3: [No Name] }{2: }{4:X}|
|
{24: [No Name] }{5: [No Name] }{2: }{24:X}|
|
||||||
^ |
|
^ |
|
||||||
{0:~ }|*4
|
{1:~ }|*4
|
||||||
{1:[No Name] }|
|
{3:[No Name] }|
|
||||||
"[No Name]" --No lines in buffer-- |
|
"[No Name]" --No lines in buffer-- |
|
||||||
]])
|
]])
|
||||||
command('vnew')
|
command('vnew')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{4: [No Name] }{3: }{5:2}{3: [No Name] }{2: }{4:X}|
|
{24: [No Name] }{5: }{100:2}{5: [No Name] }{2: }{24:X}|
|
||||||
^ │ |
|
^ │ |
|
||||||
{0:~ }│{0:~ }|*4
|
{1:~ }│{1:~ }|*4
|
||||||
{1:[No Name] }|
|
{3:[No Name] }|
|
||||||
"[No Name]" --No lines in buffer-- |
|
"[No Name]" --No lines in buffer-- |
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user