summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_arglist.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-09-04 21:29:08 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-04 21:29:08 +0100
commite1f3ab73bc7c4b3eee03b673c2983ed7eca6ea80 (patch)
tree1f99f6b4b97dce107b1fb8b311db7cbc21c9a541 /src/testdir/test_arglist.vim
parent8f7116caddc6f0725cf1211407d97645c4eb7b65 (diff)
patch 9.0.0380: deleting files in tests is a hassle
Problem: Deleting files in tests is a hassle. Solution: Use the new 'D' flag of writefile().
Diffstat (limited to 'src/testdir/test_arglist.vim')
-rw-r--r--src/testdir/test_arglist.vim15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/testdir/test_arglist.vim b/src/testdir/test_arglist.vim
index a7d707ca8e..2a46de06c1 100644
--- a/src/testdir/test_arglist.vim
+++ b/src/testdir/test_arglist.vim
@@ -97,7 +97,7 @@ endfunc
func Test_argadd_empty_curbuf()
new
let curbuf = bufnr('%')
- call writefile(['test', 'Xargadd'], 'Xargadd')
+ call writefile(['test', 'Xargadd'], 'Xargadd', 'D')
" must not re-use the current buffer.
argadd Xargadd
call assert_equal(curbuf, bufnr('%'))
@@ -108,7 +108,6 @@ func Test_argadd_empty_curbuf()
call assert_equal('Xargadd', '%'->bufname())
call assert_equal(2, line('$'))
- call delete('Xargadd')
%argd
bwipe!
endfunc
@@ -506,9 +505,9 @@ endfunc
" Test for autocommand that redefines the argument list, when doing ":all".
func Test_arglist_autocmd()
autocmd BufReadPost Xxx2 next Xxx2 Xxx1
- call writefile(['test file Xxx1'], 'Xxx1')
- call writefile(['test file Xxx2'], 'Xxx2')
- call writefile(['test file Xxx3'], 'Xxx3')
+ call writefile(['test file Xxx1'], 'Xxx1', 'D')
+ call writefile(['test file Xxx2'], 'Xxx2', 'D')
+ call writefile(['test file Xxx3'], 'Xxx3', 'D')
new
" redefine arglist; go to Xxx1
@@ -524,18 +523,14 @@ func Test_arglist_autocmd()
autocmd! BufReadPost Xxx2
enew! | only
- call delete('Xxx1')
- call delete('Xxx2')
- call delete('Xxx3')
argdelete Xxx*
bwipe! Xxx1 Xxx2 Xxx3
endfunc
func Test_arg_all_expand()
- call writefile(['test file Xxx1'], 'Xx x')
+ call writefile(['test file Xxx1'], 'Xx x', 'D')
next notexist Xx\ x runtest.vim
call assert_equal('notexist Xx\ x runtest.vim', expand('##'))
- call delete('Xx x')
endfunc
func Test_large_arg()