diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-07-12 07:25:46 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-07-12 07:30:21 +0800 |
commit | f1827d877d3dece7d743e9db28384ebd5e10550c (patch) | |
tree | 0e9ad8be021e70351d3296d77775b168f8927412 | |
parent | a61666293d83cbaab1883bbb6e4895faff515c7f (diff) | |
download | rneovim-f1827d877d3dece7d743e9db28384ebd5e10550c.tar.gz rneovim-f1827d877d3dece7d743e9db28384ebd5e10550c.tar.bz2 rneovim-f1827d877d3dece7d743e9db28384ebd5e10550c.zip |
vim-patch:partial:9.0.0418: manually deleting temp test files
Problem: Manually deleting temp test files.
Solution: Use the 'D' flag of writefile() and mkdir().
https://github.com/vim/vim/commit/45bbaef0382c5468d9fac511775bd99ea7bf5b84
This only includes test_cd.vim changes.
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | test/old/testdir/test_cd.vim | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/test/old/testdir/test_cd.vim b/test/old/testdir/test_cd.vim index 131dcc6b9a..7ef64d6ffb 100644 --- a/test/old/testdir/test_cd.vim +++ b/test/old/testdir/test_cd.vim @@ -58,18 +58,17 @@ func Test_cd_minus() call writefile(v:errors, 'Xresult') qall! [SCRIPT] - call writefile(lines, 'Xscript') + call writefile(lines, 'Xscript', 'D') if RunVim([], [], '--clean -S Xscript') call assert_equal([], readfile('Xresult')) endif - call delete('Xscript') call delete('Xresult') endfunc " Test for chdir() func Test_chdir_func() let topdir = getcwd() - call mkdir('Xchdir/y/z', 'p') + call mkdir('Xchdir/y/z', 'pR') " Create a few tabpages and windows with different directories new @@ -110,13 +109,12 @@ func Test_chdir_func() only | tabonly call chdir(topdir) - call delete('Xchdir', 'rf') endfunc " Test for changing to the previous directory '-' func Test_prev_dir() let topdir = getcwd() - call mkdir('Xprevdir/a/b/c', 'p') + call mkdir('Xprevdir/a/b/c', 'pR') " Create a few tabpages and windows with different directories new | only @@ -173,7 +171,6 @@ func Test_prev_dir() only | tabonly call chdir(topdir) - call delete('Xprevdir', 'rf') endfunc func Test_lcd_split() @@ -201,22 +198,18 @@ func Test_cd_from_non_existing_dir() endfunc func Test_cd_completion() - call mkdir('XComplDir1', 'p') - call mkdir('XComplDir2', 'p') - call writefile([], 'XComplFile') + call mkdir('XComplDir1', 'D') + call mkdir('XComplDir2', 'D') + call writefile([], 'XComplFile', 'D') for cmd in ['cd', 'chdir', 'lcd', 'lchdir', 'tcd', 'tchdir'] call feedkeys(':' .. cmd .. " XCompl\<C-A>\<C-B>\"\<CR>", 'tx') call assert_equal('"' .. cmd .. ' XComplDir1/ XComplDir2/', @:) endfor - - call delete('XComplDir1', 'd') - call delete('XComplDir2', 'd') - call delete('XComplFile') endfunc func Test_cd_unknown_dir() - call mkdir('Xa') + call mkdir('Xa', 'R') cd Xa call writefile(['text'], 'Xb.txt') edit Xa/Xb.txt @@ -229,7 +222,6 @@ func Test_cd_unknown_dir() bwipe! exe "bwipe! " .. first_buf - call delete('Xa', 'rf') endfunc func Test_getcwd_actual_dir() @@ -237,7 +229,7 @@ func Test_getcwd_actual_dir() CheckOption autochdir let startdir = getcwd() - call mkdir('Xactual') + call mkdir('Xactual', 'R') call test_autochdir() set autochdir edit Xactual/file.txt @@ -251,7 +243,6 @@ func Test_getcwd_actual_dir() set noautochdir bwipe! call chdir(startdir) - call delete('Xactual', 'rf') endfunc " vim: shiftwidth=2 sts=2 expandtab |