aboutsummaryrefslogtreecommitdiff
path: root/test/functional/eval/executable_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-04-01 23:21:38 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-04-02 01:28:11 +0200
commitc7039fd0d3f6f5d7c8699fd88095e100f0754e59 (patch)
tree7ac75bbe0a92a3d17fe2880d7bb2b52f58127830 /test/functional/eval/executable_spec.lua
parent70a0a12b5397b8b787a3196e9196f5fdbf979cf6 (diff)
downloadrneovim-c7039fd0d3f6f5d7c8699fd88095e100f0754e59.tar.gz
rneovim-c7039fd0d3f6f5d7c8699fd88095e100f0754e59.tar.bz2
rneovim-c7039fd0d3f6f5d7c8699fd88095e100f0754e59.zip
test: "$PATHEXT=::"
Diffstat (limited to 'test/functional/eval/executable_spec.lua')
-rw-r--r--test/functional/eval/executable_spec.lua19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/functional/eval/executable_spec.lua b/test/functional/eval/executable_spec.lua
index efce0745ad..6a95128a4d 100644
--- a/test/functional/eval/executable_spec.lua
+++ b/test/functional/eval/executable_spec.lua
@@ -136,7 +136,14 @@ describe('executable() (Windows)', function()
eq(1, call('executable', '.\\test_executable_zzz'))
end)
- it('returns 1 for any existing filename, when a Unix-shell like \'shell\'', function()
+ it("with weird $PATHEXT", function()
+ clear({env={PATHEXT=';'}})
+ eq(0, call('executable', '.\\test_executable_zzz'))
+ clear({env={PATHEXT=';;;.zzz;;'}})
+ eq(1, call('executable', '.\\test_executable_zzz'))
+ end)
+
+ it("unqualified filename, Unix-style 'shell'", function()
clear({env={PATHEXT=''}})
command('set shell=sh')
for _,ext in ipairs(exts) do
@@ -145,7 +152,7 @@ describe('executable() (Windows)', function()
eq(1, call('executable', 'test_executable_zzz.zzz'))
end)
- it('returns 1 for any existing path, when a Unix-shell like \'shell\' (backslashes)', function()
+ it("relative path, Unix-style 'shell' (backslashes)", function()
clear({env={PATHEXT=''}})
command('set shell=bash.exe')
for _,ext in ipairs(exts) do
@@ -156,7 +163,7 @@ describe('executable() (Windows)', function()
eq(1, call('executable', './test_executable_zzz.zzz'))
end)
- it('returns 1 for any existing filename, when $PATHEXT contain dot itself', function()
+ it('unqualified filename, $PATHEXT contains dot', function()
clear({env={PATHEXT='.;.zzz'}})
for _,ext in ipairs(exts) do
eq(1, call('executable', 'test_executable_'..ext..'.'..ext))
@@ -169,7 +176,7 @@ describe('executable() (Windows)', function()
eq(1, call('executable', 'test_executable_zzz.zzz'))
end)
- it('returns 1 for any existing path, when $PATHEXT contain dot itself (backslashes)', function()
+ it('relative path, $PATHEXT contains dot (backslashes)', function()
clear({env={PATHEXT='.;.zzz'}})
for _,ext in ipairs(exts) do
eq(1, call('executable', '.\\test_executable_'..ext..'.'..ext))
@@ -179,12 +186,12 @@ describe('executable() (Windows)', function()
eq(1, call('executable', './test_executable_zzz.zzz'))
end)
- it('ignore case of extension', function()
+ it('ignores case of extension', function()
clear({env={PATHEXT='.ZZZ'}})
eq(1, call('executable', 'test_executable_zzz.zzz'))
end)
- it('file is not found by relative path from $PATH', function()
+ it('relative path does not search $PATH', function()
clear({env={PATHEXT=''}})
eq(0, call('executable', './System32/notepad.exe'))
eq(0, call('executable', '.\\System32\\notepad.exe'))