patch 9.0.0719: too many delete() calls in tests
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
diff --git a/src/testdir/test_substitute.vim b/src/testdir/test_substitute.vim
index 1e73ba6..67df60f 100644
--- a/src/testdir/test_substitute.vim
+++ b/src/testdir/test_substitute.vim
@@ -860,7 +860,7 @@
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
@@ -876,7 +876,6 @@
call assert_equal([], readfile('Xresult'))
endif
- call delete('Xscript')
call delete('Xresult')
endfunc
@@ -1075,13 +1074,12 @@
redir END
qall!
[SCRIPT]
- call writefile(lines, 'Xscript')
+ call writefile(lines, 'Xscript', 'D')
if RunVim([], [], '-u NONE -S Xscript')
call assert_match('E565: Not allowed to change text or change window',
\ readfile('Xresult')->join('XX'))
endif
- call delete('Xscript')
call delete('Xresult')
endfunc