aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/ex_terminal_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/terminal/ex_terminal_spec.lua')
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 7a9d2a9b36..9bb683f25f 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -79,6 +79,30 @@ describe(':terminal (with fake shell)', function()
]])
end)
+ it("with no argument, and 'shell' is set to empty string", function()
+ nvim('set_option', 'shell', '')
+ terminal_with_fake_shell()
+ wait()
+ screen:expect([[
+ ^ |
+ ~ |
+ ~ |
+ E91: 'shell' option is empty |
+ ]])
+ end)
+
+ it("with no argument, but 'shell' has arguments, acts like termopen()", function()
+ nvim('set_option', 'shell', nvim_dir..'/shell-test -t jeff')
+ terminal_with_fake_shell()
+ wait()
+ screen:expect([[
+ jeff $ |
+ [Process exited 0] |
+ |
+ -- TERMINAL -- |
+ ]])
+ end)
+
it('executes a given command through the shell', function()
terminal_with_fake_shell('echo hi')
wait()
@@ -90,6 +114,18 @@ describe(':terminal (with fake shell)', function()
]])
end)
+ it("executes a given command through the shell, when 'shell' has arguments", function()
+ nvim('set_option', 'shell', nvim_dir..'/shell-test -t jeff')
+ terminal_with_fake_shell('echo hi')
+ wait()
+ screen:expect([[
+ jeff $ echo hi |
+ |
+ [Process exited 0] |
+ -- TERMINAL -- |
+ ]])
+ end)
+
it('allows quotes and slashes', function()
terminal_with_fake_shell([[echo 'hello' \ "world"]])
wait()