aboutsummaryrefslogtreecommitdiff
path: root/test/unit/os/shell_spec.lua
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2015-04-15 13:05:30 -0400
committerScott Prager <splinterofchaos@gmail.com>2015-05-02 09:47:30 -0400
commit1eb33969220b267cf45adb286f0b7b6d14805eff (patch)
tree8c4e587c91bbf91748c7ace6338aa3f609eaec0f /test/unit/os/shell_spec.lua
parent74aef8972048c3288a3cbd6a8dadf17a8df3c08c (diff)
downloadrneovim-1eb33969220b267cf45adb286f0b7b6d14805eff.tar.gz
rneovim-1eb33969220b267cf45adb286f0b7b6d14805eff.tar.bz2
rneovim-1eb33969220b267cf45adb286f0b7b6d14805eff.zip
unify jobstart, termopen, and system interfaces
For any of these functions, if {cmd} is a string, execute "&shell &shellcmdflag '{cmd}'", or simply {cmd} if it's a list. In termopen(), if the 'name' option is not supplied, try to guess using '{cmd}' (string) or {cmd}[0] (list). Simplify ex_terminal to use the string form of termopen(). termopen: get name from argument Convert list_to_argv to tv_to_argv. Helped-by: Björn Linse <@bfredl> Helped-by: oni-link <knil.ino@gmail.com> Helped-by: Thiago de Arruda <@tarruda>
Diffstat (limited to 'test/unit/os/shell_spec.lua')
-rw-r--r--test/unit/os/shell_spec.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua
index 03aafe7e3c..91d807da0b 100644
--- a/test/unit/os/shell_spec.lua
+++ b/test/unit/os/shell_spec.lua
@@ -40,7 +40,9 @@ describe('shell functions', function()
local output = ffi.new('char *[1]')
local nread = ffi.new('size_t[1]')
- local status = shell.os_system(to_cstr(cmd), input_or, input_len, output, nread)
+ local argv = ffi.cast('char**',
+ shell.shell_build_argv(to_cstr(cmd), nil))
+ local status = shell.os_system(argv, input_or, input_len, output, nread)
return status, intern(output[0], nread[0])
end