vim-patch:8.2.2035: MS-Windows: some tests may fail (#38969)

Problem:    MS-Windows: some tests may fail.
Solution:   Avoid test failures. (Yegappan Lakshmanan, closes vim/vim#7346)

f637bceb61

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2026-04-11 19:10:28 -04:00
committed by GitHub
parent 56fe6713ca
commit 4a289bfce3
2 changed files with 11 additions and 3 deletions

View File

@@ -305,6 +305,7 @@ func Test_ex_mode_with_global()
call assert_equal(1, RunVim([], [], '-e -s -S Xexmodescript'))
call assert_equal(['done'], readfile('Xdidexmode'))
call delete('logfile')
call delete('Xdidexmode')
call delete('Xexmodescript')
endfunc

View File

@@ -1941,11 +1941,18 @@ func Test_Executable()
endfunc
func Test_executable_longname()
if !has('win32')
return
CheckMSWindows
" 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('あ', 200) . '.bat'
let fname = 'X' . repeat('あ', len) . '.bat'
call writefile([], fname)
call assert_equal(1, executable(fname))
call delete(fname)