diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
commit | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch) | |
tree | 729bbcb92231538fa61dab6c3d890b025484b7f5 /test/unit/os/shell_spec.lua | |
parent | 376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff) | |
parent | 28c04948a1c887a1cc0cb64de79fa32631700466 (diff) | |
download | rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2 rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/unit/os/shell_spec.lua')
-rw-r--r-- | test/unit/os/shell_spec.lua | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/test/unit/os/shell_spec.lua b/test/unit/os/shell_spec.lua index ae162f2317..94ad6f4a10 100644 --- a/test/unit/os/shell_spec.lua +++ b/test/unit/os/shell_spec.lua @@ -1,14 +1,14 @@ -local helpers = require('test.unit.helpers')(after_each) -local itp = helpers.gen_itp(it) -local cimported = helpers.cimport( +local t = require('test.unit.testutil') +local itp = t.gen_itp(it) +local cimported = t.cimport( './src/nvim/os/shell.h', './src/nvim/option_vars.h', './src/nvim/main.h', './src/nvim/memory.h' ) -local ffi, eq = helpers.ffi, helpers.eq -local intern = helpers.internalize -local to_cstr = helpers.to_cstr +local ffi, eq = t.ffi, t.eq +local intern = t.internalize +local to_cstr = t.to_cstr local NULL = ffi.cast('void *', 0) describe('shell functions', function() @@ -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) |