0
0
mirror of https://github.com/vim/vim.git synced 2025-10-05 05:34:07 -04:00

patch 8.1.0453: MS-Windows: executable() is not reliable

Problem:    MS-Windows: executable() is not reliable.
Solution:   Use $PATHEXT properly. (Yasuhiro Matsumoto, closes #3412)
This commit is contained in:
Bram Moolenaar
2018-10-06 15:18:45 +02:00
parent 7554c548a4
commit 8295666dc2
3 changed files with 43 additions and 5 deletions

View File

@@ -800,6 +800,19 @@ func Test_filewritable()
bw!
endfunc
func Test_Executable()
if has('win32')
call assert_equal(1, executable('notepad'))
call assert_equal(1, executable('notepad.exe'))
call assert_equal(0, executable('notepad.exe.exe'))
call assert_equal(0, executable('shell32.dll'))
call assert_equal(0, executable('win.ini'))
elseif has('unix')
call assert_equal(1, executable('cat'))
call assert_equal(0, executable('dog'))
endif
endfunc
func Test_hostname()
let hostname_vim = hostname()
if has('unix')