aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/channel_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/terminal/channel_spec.lua')
-rw-r--r--test/functional/terminal/channel_spec.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua
index b5f3c2bd31..2ca7cdb0a2 100644
--- a/test/functional/terminal/channel_spec.lua
+++ b/test/functional/terminal/channel_spec.lua
@@ -7,6 +7,7 @@ local command = helpers.command
local pcall_err = helpers.pcall_err
local feed = helpers.feed
local poke_eventloop = helpers.poke_eventloop
+local is_os = helpers.is_os
describe('terminal channel is closed and later released if', function()
local screen
@@ -92,3 +93,17 @@ describe('terminal channel is closed and later released if', function()
eq(chans - 1, eval('len(nvim_list_chans())'))
end)
end)
+
+it('chansend sends lines to terminal channel in proper order', function()
+ clear()
+ local screen = Screen.new(100, 20)
+ screen:attach()
+ local shells = is_os('win') and {'cmd.exe', 'pwsh.exe -nop', 'powershell.exe -nop'} or {'sh'}
+ for _, sh in ipairs(shells) do
+ command([[bdelete! | let id = termopen(']] .. sh .. [[')]])
+ command([[call chansend(id, ['echo "hello"', 'echo "world"', ''])]])
+ screen:expect{
+ any=[[echo "hello".*echo "world"]]
+ }
+ end
+end)