aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/tui_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-09-23 19:50:57 +0800
committerGitHub <noreply@github.com>2024-09-23 11:50:57 +0000
commit5acdc4499e2036c90172b2b085f207ee4d5cfee4 (patch)
tree50b1ba5cc934ab69635c91aaa9d0537ef4941403 /test/functional/terminal/tui_spec.lua
parentcac86e9b4c14150e321650d37a7b27e88f72c243 (diff)
downloadrneovim-5acdc4499e2036c90172b2b085f207ee4d5cfee4.tar.gz
rneovim-5acdc4499e2036c90172b2b085f207ee4d5cfee4.tar.bz2
rneovim-5acdc4499e2036c90172b2b085f207ee4d5cfee4.zip
test(tui_spec): prevent another case of race between paste and input (#30481)
Problem: When input immediately follows end of bracketed paste, the nvim_input may be processed before the nvim_paste. Solution: Ensure some waiting after the end of a bracketed paste.
Diffstat (limited to 'test/functional/terminal/tui_spec.lua')
-rw-r--r--test/functional/terminal/tui_spec.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index a8a664a568..b85ddec0f0 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -975,6 +975,7 @@ describe('TUI', function()
{3:-- TERMINAL --} |
]])
feed_data('\027[201~') -- End paste.
+ screen:expect_unchanged()
feed_data('\027[27u') -- ESC: go to Normal mode.
wait_for_mode('n')
screen:expect([[
@@ -1200,6 +1201,7 @@ describe('TUI', function()
expect_cmdline('"stuff 1 more"')
-- End the paste sequence.
feed_data('\027[201~')
+ expect_cmdline('"stuff 1 more"')
feed_data(' typed')
expect_cmdline('"stuff 1 more typed"')
end)
@@ -1243,6 +1245,7 @@ describe('TUI', function()
feed_data('line 7\nline 8\n')
-- Stop paste.
feed_data('\027[201~')
+ screen:expect_unchanged()
feed_data('\n') -- <CR> to dismiss hit-enter prompt
expect_child_buf_lines({ 'foo', '' })
-- Dot-repeat/redo is not modified by failed paste.
@@ -1290,6 +1293,7 @@ describe('TUI', function()
{}
)
feed_data('\027[200~line A\nline B\n\027[201~')
+ expect_child_buf_lines({ '' })
feed_data('ifoo\n\027[27u')
expect_child_buf_lines({ 'foo', '' })
end)
@@ -1412,7 +1416,6 @@ describe('TUI', function()
feed_data('\n')
-- Send the "stop paste" sequence.
feed_data('\027[201~')
-
screen:expect([[
|
pasted from terminal (1) |