aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-10-08 12:34:22 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-10-08 12:34:24 -0400
commit1892d28c60e97e6e54ebb8bed43e42751178cbcf (patch)
treea1dae4ac5b77d0863d9ab67923bf3236c070eecd
parentf25f42bf03b6cdc50dd85ec1dddd693aa71b6f50 (diff)
downloadrneovim-1892d28c60e97e6e54ebb8bed43e42751178cbcf.tar.gz
rneovim-1892d28c60e97e6e54ebb8bed43e42751178cbcf.tar.bz2
rneovim-1892d28c60e97e6e54ebb8bed43e42751178cbcf.zip
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.
-rw-r--r--src/nvim/testdir/test_functions.vim4
1 files changed, 2 insertions, 2 deletions
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'))