1
0
forked from aniani/vim

patch 8.2.2035: MS-Windows: some tests may fail

Problem:    MS-Windows: some tests may fail.
Solution:   Avoid test failures. (Yegappan Lakshmanan, closes #7346)
This commit is contained in:
Bram Moolenaar
2020-11-23 18:14:56 +01:00
parent 792f786aad
commit f637bceb61
4 changed files with 21 additions and 3 deletions

View File

@@ -1273,7 +1273,16 @@ endfunc
func Test_executable_longname()
CheckMSWindows
let fname = 'X' . repeat('あ', 200) . '.bat'
" Create a temporary .bat file with 205 characters in the name.
" Maximum length of a filename (including the path) on MS-Windows is 259
" characters.
" See https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation
let len = 259 - getcwd()->len() - 6
if len > 200
let len = 200
endif
let fname = 'X' . repeat('あ', len) . '.bat'
call writefile([], fname)
call assert_equal(1, executable(fname))
call delete(fname)