From 56564964e6d0956c29687e8a10cb94fe42f5c097 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 10 Oct 2022 22:39:42 +0100 Subject: patch 9.0.0719: too many delete() calls in tests Problem: Too many delete() calls in tests. Solution: Use deferred delete where possible. --- src/testdir/test_shortpathname.vim | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'src/testdir/test_shortpathname.vim') diff --git a/src/testdir/test_shortpathname.vim b/src/testdir/test_shortpathname.vim index 79b7899c86..59646308e9 100644 --- a/src/testdir/test_shortpathname.vim +++ b/src/testdir/test_shortpathname.vim @@ -42,7 +42,7 @@ func Test_ColonEight() let file2 = dir2 . '/z.txt' let nofile2 = dir2 . '/zz.txt' - call mkdir(dir1) + call mkdir(dir1, 'D') let resdir1 = substitute(fnamemodify(dir1, ':p:8'), '/$', '', '') call assert_match('\V\^c:/XX\x\x\x\x~1.Y\$', resdir1) @@ -52,9 +52,9 @@ func Test_ColonEight() let resfile2 = resdir2 . '/z.txt' let resnofile2 = resdir2 . '/zz.txt' - call mkdir(dir2) - call writefile([], file1) - call writefile([], file2) + call mkdir(dir2, 'D') + call writefile([], file1, 'D') + call writefile([], file2, 'D') call TestIt(file1, ':p:8', resfile1) call TestIt(nofile1, ':p:8', resnofile1) @@ -73,10 +73,6 @@ func Test_ColonEight() call TestIt(nofile2, ':~:8', '~' . strpart(resnofile2, strlen(resdir1))) cd c:/ - call delete(file2) - call delete(file1) - call delete(dir2, 'd') - call delete(dir1, 'd') call chdir(save_dir) endfunc @@ -86,16 +82,13 @@ func Test_ColonEight_MultiByte() let file = dir . '/日本語のファイル.txt' - call mkdir(dir) - call writefile([], file) + call mkdir(dir, 'D') + call writefile([], file, 'D') let sfile = fnamemodify(file, ':8') call assert_notequal(file, sfile) call assert_match('\~', sfile) - - call delete(file) - call delete(dir, 'd') endfunc func Test_ColonEight_notexists() -- cgit v1.2.3