diff options
author | Daniel Hahler <git@thequod.de> | 2019-09-16 19:17:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 19:17:07 +0200 |
commit | 4b2d7bb5eafde6edbbd55b563e8f73dba4165853 (patch) | |
tree | b5573f8da49b72efc0f1933fb362a11434e64017 /test/functional/terminal/scrollback_spec.lua | |
parent | 4df38ec9df4764d4b2ae0b12c1b62c34889f1aa5 (diff) | |
download | rneovim-4b2d7bb5eafde6edbbd55b563e8f73dba4165853.tar.gz rneovim-4b2d7bb5eafde6edbbd55b563e8f73dba4165853.tar.bz2 rneovim-4b2d7bb5eafde6edbbd55b563e8f73dba4165853.zip |
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.
Diffstat (limited to 'test/functional/terminal/scrollback_spec.lua')
-rw-r--r-- | test/functional/terminal/scrollback_spec.lua | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua index 7413081510..ff6a74fe89 100644 --- a/test/functional/terminal/scrollback_spec.lua +++ b/test/functional/terminal/scrollback_spec.lua @@ -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)")) |