aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/channel_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-15 06:38:43 +0800
committerGitHub <noreply@github.com>2023-10-15 06:38:43 +0800
commit85ddd0074b71d006746cb298e73e6ba2f5a52541 (patch)
tree7e9aa76a652c329b4c5a13fadcc069e6173c778b /test/functional/terminal/channel_spec.lua
parent28ef4a44925a1b1cbf291347aba43012ab038523 (diff)
downloadrneovim-85ddd0074b71d006746cb298e73e6ba2f5a52541.tar.gz
rneovim-85ddd0074b71d006746cb298e73e6ba2f5a52541.tar.bz2
rneovim-85ddd0074b71d006746cb298e73e6ba2f5a52541.zip
test(terminal/channel_spec): fix flakiness (#25649)
Diffstat (limited to 'test/functional/terminal/channel_spec.lua')
-rw-r--r--test/functional/terminal/channel_spec.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua
index 2cd02be321..51bf611860 100644
--- a/test/functional/terminal/channel_spec.lua
+++ b/test/functional/terminal/channel_spec.lua
@@ -24,6 +24,7 @@ describe('terminal channel is closed and later released if', function()
-- channel hasn't been released yet
eq("Vim(call):Can't send data to closed stream",
pcall_err(command, [[bdelete! | call chansend(id, 'test')]]))
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after one main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
@@ -40,6 +41,7 @@ describe('terminal channel is closed and later released if', function()
feed('i<CR>')
-- need to first process input
poke_eventloop()
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after another main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
@@ -55,6 +57,7 @@ describe('terminal channel is closed and later released if', function()
-- channel still hasn't been released yet
eq("Vim(call):Can't send data to closed stream",
pcall_err(command, [[bdelete | call chansend(id, 'test')]]))
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after one main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
@@ -72,6 +75,7 @@ describe('terminal channel is closed and later released if', function()
feed('i<CR>')
-- need to first process input
poke_eventloop()
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after another main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
@@ -89,6 +93,7 @@ describe('terminal channel is closed and later released if', function()
-- channel still hasn't been released yet
eq("Vim(call):Can't send data to closed stream",
pcall_err(command, [[bdelete | call chansend(id, 'test')]]))
+ feed('<Ignore>') -- add input to separate two RPC requests
-- channel has been released after one main loop iteration
eq(chans - 1, eval('len(nvim_list_chans())'))
end)