mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
tests: fix flaky 'scrollback' option deletes lines (only) if necessary (#11003)
Using `screen:expect` with the complete grid appears to fix its flakiness. Fixes https://github.com/neovim/neovim/issues/10723.
This commit is contained in:
@ -438,9 +438,29 @@ describe("'scrollback' option", function()
|
||||
command('sleep 100m')
|
||||
|
||||
feed_data(nvim_dir.."/shell-test REP 41 line"..(iswin() and '\r' or '\n'))
|
||||
screen:expect{any='40: line '}
|
||||
if iswin() then
|
||||
screen:expect{grid=[[
|
||||
37: line |
|
||||
38: line |
|
||||
39: line |
|
||||
40: line |
|
||||
|
|
||||
${1: } |
|
||||
{3:-- TERMINAL --} |
|
||||
]]}
|
||||
else
|
||||
screen:expect{grid=[[
|
||||
36: line |
|
||||
37: line |
|
||||
38: line |
|
||||
39: line |
|
||||
40: line |
|
||||
{IGNORE}|
|
||||
{3:-- TERMINAL --} |
|
||||
]]}
|
||||
end
|
||||
expect_lines(58)
|
||||
|
||||
retry(nil, nil, function() expect_lines(58) end)
|
||||
-- Verify off-screen state
|
||||
eq((iswin() and '36: line' or '35: line'), eval("getline(line('w0') - 1)"))
|
||||
eq((iswin() and '27: line' or '26: line'), eval("getline(line('w0') - 10)"))
|
||||
|
Reference in New Issue
Block a user