patch 9.0.0411: only created files can be cleaned up with one call
Problem: Only created files can be cleaned up with one call.
Solution: Add flags to mkdir() to delete with a deferred function.
Expand the writefile() name to a full path to handle changing
directory.
diff --git a/src/testdir/test_autochdir.vim b/src/testdir/test_autochdir.vim
index 332de8f..eb40253 100644
--- a/src/testdir/test_autochdir.vim
+++ b/src/testdir/test_autochdir.vim
@@ -28,9 +28,9 @@
func Test_set_filename_other_window()
let cwd = getcwd()
call test_autochdir()
- call mkdir('Xa')
- call mkdir('Xb')
- call mkdir('Xc')
+ call mkdir('Xa', 'R')
+ call mkdir('Xb', 'R')
+ call mkdir('Xc', 'R')
try
args Xa/aaa.txt Xb/bbb.txt
set acd
@@ -45,9 +45,6 @@
bwipe! aaa.txt
bwipe! bbb.txt
bwipe! ccc.txt
- call delete('Xa', 'rf')
- call delete('Xb', 'rf')
- call delete('Xc', 'rf')
endtry
endfunc
@@ -56,7 +53,7 @@
set acd
call test_autochdir()
- call mkdir('XacdDir')
+ call mkdir('XacdDir', 'R')
let winid = win_getid()
new XacdDir/file
call assert_match('testdir.XacdDir$', getcwd())
@@ -68,7 +65,6 @@
bwipe!
set noacd
call chdir(cwd)
- call delete('XacdDir', 'rf')
endfunc
func Test_verbose_pwd()
@@ -78,7 +74,7 @@
edit global.txt
call assert_match('\[global\].*testdir$', execute('verbose pwd'))
- call mkdir('Xautodir')
+ call mkdir('Xautodir', 'R')
split Xautodir/local.txt
lcd Xautodir
call assert_match('\[window\].*testdir[/\\]Xautodir', execute('verbose pwd'))
@@ -112,7 +108,6 @@
bwipe!
call chdir(cwd)
- call delete('Xautodir', 'rf')
endfunc
func Test_multibyte()