From 1892d28c60e97e6e54ebb8bed43e42751178cbcf Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 8 Oct 2018 12:34:22 -0400 Subject: oldtests: win: fix executable() assertions Windows has "Read and execute" permission via ACL but nvim and libuv do not support ACL. Windows does not support the executable bit in chmod-style permissions but it is safe to assume that if the file exists and is readable, then it is most likely executable. This means that win.ini and shell32.dll are "executable" because they exist, are readable, and are in PATH. PATHEXT does not affect the executable permission of a file; it exists to run files on the shell while omitting the file extension. Assume that PATHEXT is intended for cmd.exe only because powershell can execute powershell files (ie. *.ps1) without changing PATHEXT or related cmd.exe environment variable. In the future, nvim should check the outputs of 'assoc' and 'ftype', cmd.exe internal commands, or check the registry. Powershell can be used for ACL if C++/C# API is too difficult to use. --- src/nvim/testdir/test_functions.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index acbbd522db..4a27a119f3 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -869,8 +869,8 @@ func Test_Executable() 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')) + call assert_equal(1, executable('shell32.dll')) + call assert_equal(1, executable('win.ini')) elseif has('unix') call assert_equal(1, executable('cat')) call assert_equal(0, executable('dog')) -- cgit