diff options
-rw-r--r-- | test/old/testdir/runtest.vim | 22 | ||||
-rw-r--r-- | test/old/testdir/test_mksession.vim | 5 |
2 files changed, 22 insertions, 5 deletions
diff --git a/test/old/testdir/runtest.vim b/test/old/testdir/runtest.vim index d7468fef17..08dde1fe4f 100644 --- a/test/old/testdir/runtest.vim +++ b/test/old/testdir/runtest.vim @@ -353,6 +353,24 @@ func RunTheTest(test) endif endfunc +function Delete_Xtest_Files() + for file in glob('X*', v:false, v:true) + if file ==? 'XfakeHOME' + " Clean up files created by setup.vim + call delete('XfakeHOME', 'rf') + continue + endif + " 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) if len(v:errors) > 0 if match(s:may_fail_list, '^' .. a:func_name) >= 0 @@ -381,13 +399,11 @@ endfunc " This function can be called by a test if it wants to abort testing. func FinishTesting() call AfterTheTest('') + call Delete_Xtest_Files() " Don't write viminfo on exit. set viminfo= - " Clean up files created by setup.vim - call delete('XfakeHOME', 'rf') - if s:fail == 0 && s:fail_expected == 0 " Success, create the .res file so that make knows it's done. exe 'split ' . fnamemodify(g:testname, ':r') . '.res' diff --git a/test/old/testdir/test_mksession.vim b/test/old/testdir/test_mksession.vim index f60d89faae..eebdd2f398 100644 --- a/test/old/testdir/test_mksession.vim +++ b/test/old/testdir/test_mksession.vim @@ -731,6 +731,7 @@ func Test_mksession_foldopt() close %bwipe set sessionoptions& + call delete('Xtest_mks.out') endfunc " Test for mksession with "help" but not "options" in 'sessionoptions' @@ -857,14 +858,14 @@ func Test_mksession_shortmess_with_A() bwipe! " Recreate the swap file to pretend the file is being edited - call writefile(cont, fname) + call writefile(cont, fname, 'D') set shortmess+=A source Xtestsession set shortmess& set sessionoptions& call delete('Xtestsession') - call delete(fname) + call delete('Xtestfile') endfunc " Test for mksession with 'compatible' option |