mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
This commit is contained in:
parent
f25f42bf03
commit
1892d28c60
@ -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'))
|
||||
|
Loading…
Reference in New Issue
Block a user