diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index e2bc28d374b164..974d2e070637e4 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -411,7 +411,21 @@ func RunTheTest(test) endif endfunc +function Delete_Xtest_Files() + for file in glob('Xtest*', v:false, v:true) + call add(v:errors, file .. " exists when it shouldn't, trying to delete it!") + call delete(file) + if !empty(glob(file, v:false, v:true)) + call add(v:errors, file .. " still exists after trying to delete it!") + if has('unix') + call system('rm -rf ' .. file) + endif + endif + endfor +endfunc + func AfterTheTest(func_name) + call Delete_Xtest_Files() if len(v:errors) > 0 if match(s:may_fail_list, '^' .. a:func_name) >= 0 let s:fail_expected += 1 diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index b7d290275ba6b3..a4d8b7cb80c4ea 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -8,6 +8,19 @@ source screendump.vim set encoding=utf-8 +function Kill_Xtest_stable_xxd() + if !empty(glob('Xtest_stable_xxd.txt', v:false, v:true)) + call add(v:errors, "Xtest_stable_xxd.txt exists when it shouldn't, trying to delete it!") + call delete('Xtest_stable_xxd.txt') + if !empty(glob('Xtest_stable_xxd.txt', v:false, v:true)) + call add(v:errors, "Xtest_stable_xxd.txt still exists after trying to delete it!") + if has('unix') + call system('rm -rf Xtest_stable_xxd.txt') + endif + endif + endif +endfunc + func s:setup_commands(cchar) if a:cchar == 'c' command! -nargs=* -bang Xlist clist @@ -4255,6 +4268,7 @@ endfunc " The following test used to crash Vim func Test_lvimgrep_crash() + call Kill_Xtest_stable_xxd() sv Xtest augroup QF_Test au!