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:
Daniel Hahler
2019-09-16 19:17:07 +02:00
committed by GitHub
parent 4df38ec9df
commit 4b2d7bb5ea

View File

@ -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)"))