diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-04-09 08:51:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-09 08:51:14 +0800 |
commit | 56123fb271d0cbd70faeadf06375988fe3b56986 (patch) | |
tree | 6f221f3bb92a6d1e5a91dfd48b45c9630052ae56 /test/functional/terminal/buffer_spec.lua | |
parent | 2528093bbea8862ede0feb6eb29bdc5451a6313b (diff) | |
download | rneovim-56123fb271d0cbd70faeadf06375988fe3b56986.tar.gz rneovim-56123fb271d0cbd70faeadf06375988fe3b56986.tar.bz2 rneovim-56123fb271d0cbd70faeadf06375988fe3b56986.zip |
test(terminal/buffer_spec): avoid other keys in double clicks (#28245)
Having unrelated keys between double clicks may make the test flaky as
'mousetime' is more easily reached.
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 10d6445bf4..080df4b25f 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -482,18 +482,16 @@ describe('terminal input', function() 'colorscheme vim', '--cmd', 'set notermguicolors', - '--cmd', - 'startinsert', + '-c', + 'while 1 | redraw | call setline(1, keytrans(getcharstr())) | endwhile', }) - screen:expect { - grid = [[ + screen:expect([[ {1: } | {4:~ }|*3 - {5:[No Name] 0,1 All}| - {3:-- INSERT --} | + {5:[No Name] 0,0-1 All}| + | {3:-- TERMINAL --} | - ]], - } + ]]) for _, key in ipairs({ '<M-Tab>', '<M-CR>', @@ -543,9 +541,9 @@ describe('terminal input', function() '<ScrollWheelLeft>', '<ScrollWheelRight>', }) do - feed('<CR><C-V>' .. key) + feed(key) retry(nil, nil, function() - eq(key, api.nvim_get_current_line()) + eq(key, vim.trim(api.nvim_get_current_line())) end) end end) |