diff options
author | Daniel Hahler <git@thequod.de> | 2019-09-04 20:01:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-04 20:01:38 +0200 |
commit | d7aea13fee879a5e7854f2ebe9b7321cd8daf84f (patch) | |
tree | de1c7ff40563b93be224026bd8ff80743b3c0d1b /test/functional/terminal/scrollback_spec.lua | |
parent | bd1158f3ab16d80d632775af43e8d45ad05cc60d (diff) | |
download | rneovim-d7aea13fee879a5e7854f2ebe9b7321cd8daf84f.tar.gz rneovim-d7aea13fee879a5e7854f2ebe9b7321cd8daf84f.tar.bz2 rneovim-d7aea13fee879a5e7854f2ebe9b7321cd8daf84f.zip |
tests: scrollback_spec: use shell-test instead of awk (#10914)
Ref: #10804
Ref: b64af88
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) |