#5057: Avoid mixing slashes for Windows temporary files

This commit is contained in:
w0rp
2026-05-14 22:30:52 +01:00
parent c809c68f7e
commit 641294465e
5 changed files with 62 additions and 10 deletions
+13
View File
@@ -34,6 +34,7 @@ After:
delfunction CheckTempFile
delfunction GetTempBase
runtime autoload/ale/util.vim
runtime autoload/ale/command.vim
Execute(FormatCommand should do nothing to basic command strings):
@@ -69,6 +70,18 @@ Execute(FormatCommand should convert %t to a new temporary filename):
" The two temporary filenames formatted in should be the same.
AssertEqual g:match[1], g:match[2]
Execute(FormatCommand should normalize mixed Windows temporary paths):
if has('win32')
function! ale#util#Tempname() abort
return 'D:/Personal/Temp/V6UA83E.tmp'
endfunction
let g:result = ale#command#FormatCommand(bufnr('%'), '', '%t', 0, v:null, v:null, [])
AssertEqual 'D:\Personal\Temp\V6UA83E.tmp\dummy.txt', g:result[0]
AssertEqual ale#Escape(g:result[0]), g:result[1]
endif
Execute(FormatCommand should not convert %t to a new temporary filename when the input is given as v:false):
let g:result = ale#command#FormatCommand(bufnr('%'), '', 'foo %t bar %t', 0, v:false, v:null, [])