aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/executable_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-07-21 16:37:07 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-07-21 20:51:37 +0200
commitb08dc3ec195feb4ab69c898ab816c104d2aa1aa1 (patch)
tree3e614d685f1b0335719df538377b93a491eae3ed /test/functional/eval/executable_spec.lua
parent9d0f8224c97b36116f3c0523bcf6941382892a5b (diff)
downloadrneovim-b08dc3ec195feb4ab69c898ab816c104d2aa1aa1.tar.gz
rneovim-b08dc3ec195feb4ab69c898ab816c104d2aa1aa1.tar.bz2
rneovim-b08dc3ec195feb4ab69c898ab816c104d2aa1aa1.zip
win: jobstart(), system(): $PATHEXT-resolve exe
Windows: In order for jobstart(['foo']), system(['foo']) to find "foo.cmd", we must replace "foo" with "foo.cmd" before sending `argv` to process_spawn(). Rationale: jobstart([…]), system([…]) "executable" semantics should be consistent with the VimL executable() function. fix #9569 related: #10554
Diffstat (limited to 'test/functional/eval/executable_spec.lua')
-rw-r--r--test/functional/eval/executable_spec.lua11
1 files changed, 9 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'))