diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-10-10 22:39:42 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-10-10 22:39:42 +0100 |
commit | 56564964e6d0956c29687e8a10cb94fe42f5c097 (patch) | |
tree | 81b20215b72afa749b03c385c428e60307878d83 /src/testdir/test_shortpathname.vim | |
parent | ccf2837a05cef0ea4913ebff4f2f6000bc050271 (diff) |
patch 9.0.0719: too many delete() calls in testsv9.0.0719
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
Diffstat (limited to 'src/testdir/test_shortpathname.vim')
-rw-r--r-- | src/testdir/test_shortpathname.vim | 19 |
1 files changed, 6 insertions, 13 deletions
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() |