aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-07-21 22:58:39 +0200
committerGitHub <noreply@github.com>2019-07-21 22:58:39 +0200
commit27fb8933f577010a997a3c8a55d55c2186a267cb (patch)
tree365f8c6e17b593e5350bdd927ecf237363724de4 /test
parent9d0f8224c97b36116f3c0523bcf6941382892a5b (diff)
parent1fde79eedf0091af1b04ce3d91045672cb3c233e (diff)
downloadrneovim-27fb8933f577010a997a3c8a55d55c2186a267cb.tar.gz
rneovim-27fb8933f577010a997a3c8a55d55c2186a267cb.tar.bz2
rneovim-27fb8933f577010a997a3c8a55d55c2186a267cb.zip
Merge #10561 from justinmk/os_can_exe
jobstart(), system(): use $PATHEXT-resolved exe
Diffstat (limited to 'test')
-rw-r--r--test/functional/eval/executable_spec.lua11
-rw-r--r--test/functional/fixtures/cmdscript.cmd2
2 files changed, 11 insertions, 2 deletions
diff --git a/test/functional/eval/executable_spec.lua b/test/functional/eval/executable_spec.lua
index 1107fe6a0b..a1cf056907 100644
--- a/test/functional/eval/executable_spec.lua
+++ b/test/functional/eval/executable_spec.lua
@@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local eq, clear, call, iswin, write_file, command =
helpers.eq, helpers.clear, helpers.call, helpers.iswin, helpers.write_file,
helpers.command
+local eval = helpers.eval
describe('executable()', function()
before_each(clear)
@@ -95,10 +96,16 @@ describe('executable() (Windows)', function()
eq(0, call('executable', '.\\test_executable_zzz'))
end)
+ it('system([…]), jobstart([…]) use $PATHEXT #9569', function()
+ -- Invoking `cmdscript` should find/execute `cmdscript.cmd`.
+ eq('much success\n', call('system', {'test/functional/fixtures/cmdscript'}))
+ assert(0 < call('jobstart', {'test/functional/fixtures/cmdscript'}))
+ end)
+
it('full path with extension', function()
-- Some executable we can expect in the test env.
local exe = 'printargs-test'
- local exedir = helpers.eval("fnamemodify(v:progpath, ':h')")
+ local exedir = eval("fnamemodify(v:progpath, ':h')")
local exepath = exedir..'/'..exe..'.exe'
eq(1, call('executable', exepath))
eq('arg1=lemon;arg2=sky;arg3=tree;',
@@ -108,7 +115,7 @@ describe('executable() (Windows)', function()
it('full path without extension', function()
-- Some executable we can expect in the test env.
local exe = 'printargs-test'
- local exedir = helpers.eval("fnamemodify(v:progpath, ':h')")
+ local exedir = eval("fnamemodify(v:progpath, ':h')")
local exepath = exedir..'/'..exe
eq('arg1=lemon;arg2=sky;arg3=tree;',
call('system', exepath..' lemon sky tree'))
diff --git a/test/functional/fixtures/cmdscript.cmd b/test/functional/fixtures/cmdscript.cmd
new file mode 100644
index 0000000000..b680d24900
--- /dev/null
+++ b/test/functional/fixtures/cmdscript.cmd
@@ -0,0 +1,2 @@
+@echo off
+echo much success