mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
test(terminal/buffer_spec): use screen:expect(), not retry() (#28246)
Without creating new lines, using screen:expect() is faster and avoids RPC requests.
This commit is contained in:
@@ -483,7 +483,7 @@ describe('terminal input', function()
|
|||||||
'--cmd',
|
'--cmd',
|
||||||
'set notermguicolors',
|
'set notermguicolors',
|
||||||
'-c',
|
'-c',
|
||||||
'while 1 | redraw | call setline(1, keytrans(getcharstr())) | endwhile',
|
'while 1 | redraw | echo keytrans(getcharstr()) | endwhile',
|
||||||
})
|
})
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: } |
|
{1: } |
|
||||||
@@ -542,9 +542,13 @@ describe('terminal input', function()
|
|||||||
'<ScrollWheelRight>',
|
'<ScrollWheelRight>',
|
||||||
}) do
|
}) do
|
||||||
feed(key)
|
feed(key)
|
||||||
retry(nil, nil, function()
|
screen:expect(([[
|
||||||
eq(key, vim.trim(api.nvim_get_current_line()))
|
|
|
||||||
end)
|
{4:~ }|*3
|
||||||
|
{5:[No Name] 0,0-1 All}|
|
||||||
|
%s{1: }{MATCH: *}|
|
||||||
|
{3:-- TERMINAL --} |
|
||||||
|
]]):format(key))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user