aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/channel_spec.lua
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2021-11-12 00:07:03 +0900
committerzeertzjq <zeertzjq@outlook.com>2022-03-12 19:23:45 +0800
commit5051510ade5f171c1239906c8638e804356186fe (patch)
tree43ce21d99a58a7c77baf6f98d0c5234070db93e4 /test/functional/terminal/channel_spec.lua
parentab456bc304965d83585cd248284cb36c96927457 (diff)
downloadrneovim-5051510ade5f171c1239906c8638e804356186fe.tar.gz
rneovim-5051510ade5f171c1239906c8638e804356186fe.tar.bz2
rneovim-5051510ade5f171c1239906c8638e804356186fe.zip
fix(channel): fix channel consistency
- Fix the problem that chanclose() does not work for channel created by nvim_open_term(). - Fix the problem that the loopback channel is not released. - Fix the error message when sending raw data to the loopback channel.
Diffstat (limited to 'test/functional/terminal/channel_spec.lua')
-rw-r--r--test/functional/terminal/channel_spec.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua
index 7223f5ba61..a0aa8c0708 100644
--- a/test/functional/terminal/channel_spec.lua
+++ b/test/functional/terminal/channel_spec.lua
@@ -43,3 +43,13 @@ describe('associated channel is closed and later freed for terminal', function()
eq("Vim(call):E900: Invalid channel id", pcall_err(command, [[call chansend(id, 'test')]]))
end)
end)
+
+describe('channel created by nvim_open_term', function()
+ before_each(clear)
+
+ it('can close', function()
+ command('let id = nvim_open_term(0, {})')
+ eq("Vim(call):Can't send data to closed stream",
+ pcall_err(command, [[call chanclose(id) | call chansend(id, 'test')]]))
+ end)
+end)