test(ui/searchhl_spec): match more in :terminal test (#25631)

This commit is contained in:
zeertzjq 2023-10-14 13:53:52 +08:00 committed by GitHub
parent bf70a33f5e
commit ce0f80835a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,8 @@ describe('search highlighting', function()
[1] = {bold=true, foreground=Screen.colors.Blue}, [1] = {bold=true, foreground=Screen.colors.Blue},
[2] = {background = Screen.colors.Yellow}, -- Search [2] = {background = Screen.colors.Yellow}, -- Search
[3] = {reverse = true}, [3] = {reverse = true},
[4] = {foreground = Screen.colors.Red}, -- Message [4] = {foreground = Screen.colors.Red}, -- WarningMsg
[5] = {bold = true, reverse = true}, -- StatusLine
[6] = {foreground = Screen.colors.Blue4, background = Screen.colors.LightGrey}, -- Folded [6] = {foreground = Screen.colors.Blue4, background = Screen.colors.LightGrey}, -- Folded
}) })
end) end)
@ -326,19 +327,33 @@ describe('search highlighting', function()
it('is preserved during :terminal activity', function() it('is preserved during :terminal activity', function()
feed((':terminal "%s" REP 5000 foo<cr>'):format(testprg('shell-test'))) feed((':terminal "%s" REP 5000 foo<cr>'):format(testprg('shell-test')))
feed(':file term<CR>') feed(':file term<CR>')
screen:expect([[
^0: foo |
1: foo |
2: foo |
3: foo |
4: foo |
5: foo |
:file term |
]])
feed('G') -- Follow :terminal output. feed('G') -- Follow :terminal output.
feed(':vnew<CR>') feed(':vnew<CR>')
insert([[ insert([[
foo bar baz foo bar baz
bar baz foo bar baz foo
bar foo baz bar foo baz]])
]])
feed('/foo') feed('/foo')
helpers.poke_eventloop() screen:expect([[
screen:sleep(100) {3:foo} bar baz {MATCH:%d+}: {2:foo}{MATCH:%s+}|
screen:expect_unchanged() bar baz {2:foo} {MATCH:%d+}: {2:foo}{MATCH:%s+}|
bar {2:foo} baz {MATCH:%d+}: {2:foo}{MATCH:%s+}|
{1:~ }{MATCH:.*}|
{1:~ }{MATCH:.*}|
{5:[No Name] [+] }{3:term }|
/foo^ |
]])
end) end)
it('works with incsearch', function() it('works with incsearch', function()