diff options
Diffstat (limited to 'test/functional/terminal/scrollback_spec.lua')
-rw-r--r-- | test/functional/terminal/scrollback_spec.lua | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua index 065cb98e69..f4441a5396 100644 --- a/test/functional/terminal/scrollback_spec.lua +++ b/test/functional/terminal/scrollback_spec.lua @@ -403,12 +403,8 @@ describe("'scrollback' option", function() end curbufmeths.set_option('scrollback', 0) - if iswin() then - feed_data('for /L %I in (1,1,30) do @(echo line%I)\r') - else - feed_data('awk "BEGIN{for(n=1;n<=30;n++) print \\\"line\\\" n}"\n') - end - screen:expect{any='line30 '} + feed_data(nvim_dir..'/shell-test REP 31 line'..(iswin() and '\r' or '\n')) + screen:expect{any='30: line '} retry(nil, nil, function() expect_lines(7) end) screen:detach() @@ -428,13 +424,8 @@ describe("'scrollback' option", function() -- Wait for prompt. screen:expect{any='%$'} - if iswin() then - feed_data('for /L %I in (1,1,30) do @(echo line%I)\r') - else - feed_data('awk "BEGIN{for(n=1;n<=30;n++) print \\\"line\\\" n}"\n') - end - - screen:expect{any='line30 '} + feed_data(nvim_dir.."/shell-test REP 31 line"..(iswin() and '\r' or '\n')) + screen:expect{any='30: line '} retry(nil, nil, function() expect_lines(33, 2) end) curbufmeths.set_option('scrollback', 10) @@ -445,18 +436,14 @@ describe("'scrollback' option", function() -- Terminal job data is received asynchronously, may happen before the -- 'scrollback' option is synchronized with the internal sb_buffer. command('sleep 100m') - if iswin() then - feed_data('for /L %I in (1,1,40) do @(echo line%I)\r') - else - feed_data('awk "BEGIN{for(n=1;n<=40;n++) print \\\"line\\\" n}"\n') - end - screen:expect{any='line40 '} + feed_data(nvim_dir.."/shell-test REP 41 line"..(iswin() and '\r' or '\n')) + screen:expect{any='40: line '} retry(nil, nil, function() expect_lines(58) end) -- Verify off-screen state - eq((iswin() and 'line36' or 'line35'), eval("getline(line('w0') - 1)")) - eq((iswin() and 'line27' or 'line26'), eval("getline(line('w0') - 10)")) + 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)")) screen:detach() end) |