aboutsummaryrefslogtreecommitdiff
path: root/test/unit/os/shell_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/os/shell_spec.lua')
-rw-r--r--test/unit/os/shell_spec.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua
index ae162f2317..05f965585a 100644
--- a/test/unit/os/shell_spec.lua
+++ b/test/unit/os/shell_spec.lua
@@ -125,9 +125,9 @@ describe('shell functions', function()
cimported.p_sxe = to_cstr('"&|<>()@^')
local argv = ffi.cast('char**', cimported.shell_build_argv(to_cstr('echo &|<>()@^'), nil))
- eq(ffi.string(argv[0]), '/bin/sh')
- eq(ffi.string(argv[1]), '-c')
- eq(ffi.string(argv[2]), '(echo ^&^|^<^>^(^)^@^^)')
+ eq('/bin/sh', ffi.string(argv[0]))
+ eq('-c', ffi.string(argv[1]))
+ eq('(echo ^&^|^<^>^(^)^@^^)', ffi.string(argv[2]))
eq(nil, argv[3])
end)
@@ -136,9 +136,9 @@ describe('shell functions', function()
cimported.p_sxe = to_cstr('"&|<>()@^')
local argv = ffi.cast('char**', cimported.shell_build_argv(to_cstr('echo -n some text'), nil))
- eq(ffi.string(argv[0]), '/bin/sh')
- eq(ffi.string(argv[1]), '-c')
- eq(ffi.string(argv[2]), '"(echo -n some text)"')
+ eq('/bin/sh', ffi.string(argv[0]))
+ eq('-c', ffi.string(argv[1]))
+ eq('"(echo -n some text)"', ffi.string(argv[2]))
eq(nil, argv[3])
end)
@@ -147,17 +147,17 @@ describe('shell functions', function()
cimported.p_sxe = to_cstr('')
local argv = ffi.cast('char**', cimported.shell_build_argv(to_cstr('echo -n some text'), nil))
- eq(ffi.string(argv[0]), '/bin/sh')
- eq(ffi.string(argv[1]), '-c')
- eq(ffi.string(argv[2]), '"echo -n some text"')
+ eq('/bin/sh', ffi.string(argv[0]))
+ eq('-c', ffi.string(argv[1]))
+ eq('"echo -n some text"', ffi.string(argv[2]))
eq(nil, argv[3])
end)
itp('with empty shellxquote/shellxescape', function()
local argv = ffi.cast('char**', cimported.shell_build_argv(to_cstr('echo -n some text'), nil))
- eq(ffi.string(argv[0]), '/bin/sh')
- eq(ffi.string(argv[1]), '-c')
- eq(ffi.string(argv[2]), 'echo -n some text')
+ eq('/bin/sh', ffi.string(argv[0]))
+ eq('-c', ffi.string(argv[1]))
+ eq('echo -n some text', ffi.string(argv[2]))
eq(nil, argv[3])
end)
end)