Mercurial > vim
diff src/testdir/test_functions.vim @ 14883:1c2ba2b0227e v8.1.0453
patch 8.1.0453: MS-Windows: executable() is not reliable
commit https://github.com/vim/vim/commit/8295666dc2c65e42135b91d5c61e2a140d002333
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 6 15:18:45 2018 +0200
patch 8.1.0453: MS-Windows: executable() is not reliable
Problem: MS-Windows: executable() is not reliable.
Solution: Use $PATHEXT properly. (Yasuhiro Matsumoto, closes https://github.com/vim/vim/issues/3412)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 06 Oct 2018 15:30:06 +0200 |
parents | 63d5ae57a663 |
children | 5e47597de905 |
line wrap: on
line diff
--- a/src/testdir/test_functions.vim +++ b/src/testdir/test_functions.vim @@ -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')