aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/buffer_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-09 09:32:27 +0800
committerGitHub <noreply@github.com>2024-04-09 09:32:27 +0800
commit6d1e41432d6e8e0be586b5d9ba29e78ce2cba26d (patch)
tree60c13f25282e9f769ea71709ca35116f49ac5f49 /test/functional/terminal/buffer_spec.lua
parent56123fb271d0cbd70faeadf06375988fe3b56986 (diff)
downloadrneovim-6d1e41432d6e8e0be586b5d9ba29e78ce2cba26d.tar.gz
rneovim-6d1e41432d6e8e0be586b5d9ba29e78ce2cba26d.tar.bz2
rneovim-6d1e41432d6e8e0be586b5d9ba29e78ce2cba26d.zip
test(terminal/buffer_spec): use screen:expect(), not retry() (#28246)
Without creating new lines, using screen:expect() is faster and avoids RPC requests.
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r--test/functional/terminal/buffer_spec.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 080df4b25f..341d6ee862 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -483,7 +483,7 @@ describe('terminal input', function()
'--cmd',
'set notermguicolors',
'-c',
- 'while 1 | redraw | call setline(1, keytrans(getcharstr())) | endwhile',
+ 'while 1 | redraw | echo keytrans(getcharstr()) | endwhile',
})
screen:expect([[
{1: } |
@@ -542,9 +542,13 @@ describe('terminal input', function()
'<ScrollWheelRight>',
}) do
feed(key)
- retry(nil, nil, function()
- eq(key, vim.trim(api.nvim_get_current_line()))
- end)
+ screen:expect(([[
+ |
+ {4:~ }|*3
+ {5:[No Name] 0,0-1 All}|
+ %s{1: }{MATCH: *}|
+ {3:-- TERMINAL --} |
+ ]]):format(key))
end
end)
end)