diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-02-03 16:56:31 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-02-04 11:07:50 +0100 |
commit | 67fbbdb1b5eb6e48c7c533042abba9e409833ca6 (patch) | |
tree | e99ae56f4f3140564e91d7b136018b61103105be /test/functional/eval/executable_spec.lua | |
parent | cd5b1315757ed3c66aa63c6df69582503c5b81dd (diff) | |
download | rneovim-67fbbdb1b5eb6e48c7c533042abba9e409833ca6.tar.gz rneovim-67fbbdb1b5eb6e48c7c533042abba9e409833ca6.tar.bz2 rneovim-67fbbdb1b5eb6e48c7c533042abba9e409833ca6.zip |
win: executable(): full path without extension
Absolute path is considered executable even *without* an extension.
Diffstat (limited to 'test/functional/eval/executable_spec.lua')
-rw-r--r-- | test/functional/eval/executable_spec.lua | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/test/functional/eval/executable_spec.lua b/test/functional/eval/executable_spec.lua index 13b9261d82..7948ddaa40 100644 --- a/test/functional/eval/executable_spec.lua +++ b/test/functional/eval/executable_spec.lua @@ -20,14 +20,8 @@ describe('executable()', function() -- Windows: siblings are in Nvim's "pseudo-$PATH". local expected = iswin() and 1 or 0 if iswin() then - print('XXXXXXXXXXXXXXXXXXXXXXXXX') - print(helpers.eval('$PATH')) - print('XXXXXXXXXXXXXXXXXXXXXXXXX') -- $PATH on AppVeyor CI might be oversized, redefine it to a minimal one. clear({env={PATH=[[C:\Windows\system32;C:\Windows]]}}) - print(helpers.eval('$PATH')) - print('XXXXXXXXXXXXXXXXXXXXXXXXX') - print(helpers.eval("echo glob(fnamemodify(exepath(v:progpath), ':h').'/*')")) eq('arg1=lemon;arg2=sky;arg3=tree;', call('system', sibling_exe..' lemon sky tree')) end @@ -103,6 +97,26 @@ describe('executable() (Windows)', function() eq(0, call('executable', '.\\test_executable_zzz')) 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 exepath = exedir..'/'..exe..'.exe' + eq(1, call('executable', exepath)) + eq('arg1=lemon;arg2=sky;arg3=tree;', + call('system', exepath..' lemon sky tree')) + end) + + 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 exepath = exedir..'/'..exe + eq('arg1=lemon;arg2=sky;arg3=tree;', + call('system', exepath..' lemon sky tree')) + eq(1, call('executable', exepath)) + end) + it('respects $PATHEXT when trying extensions on a filename', function() clear({env={PATHEXT='.zzz'}}) for _,ext in ipairs(exts) do |