From 56123fb271d0cbd70faeadf06375988fe3b56986 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 9 Apr 2024 08:51:14 +0800 Subject: 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. --- test/functional/terminal/buffer_spec.lua | 18 ++++++++---------- 1 file 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({ '', '', @@ -543,9 +541,9 @@ describe('terminal input', function() '', '', }) do - feed('' .. 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) -- cgit