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_spell.vim b/src/testdir/test_spell.vim
index 3f77695..4a7a46c 100644
--- a/src/testdir/test_spell.vim
+++ b/src/testdir/test_spell.vim
@@ -762,8 +762,8 @@
func Test_zz_sal_and_addition()
set enc=latin1
set spellfile=
- call writefile(g:test_data_dic1, "Xtest.dic")
- call writefile(g:test_data_aff_sal, "Xtest.aff")
+ call writefile(g:test_data_dic1, "Xtest.dic", 'D')
+ call writefile(g:test_data_aff_sal, "Xtest.aff", 'D')
mkspell! Xtest Xtest
set spl=Xtest.latin1.spl spell
call assert_equal('kbltykk', soundfold('goobledygoook'))
@@ -771,7 +771,7 @@
call assert_equal('*fls kswts tl', soundfold('oeverloos gezwets edale'))
"also use an addition file
- call writefile(["/regions=usgbnz", "elequint/2", "elekwint/3"], "Xtest.latin1.add")
+ call writefile(["/regions=usgbnz", "elequint/2", "elekwint/3"], "Xtest.latin1.add", 'D')
mkspell! Xtest.latin1.add.spl Xtest.latin1.add
bwipe!
@@ -808,10 +808,9 @@
func Test_region_error()
messages clear
- call writefile(["/regions=usgbnz", "elequint/0"], "Xtest.latin1.add")
+ call writefile(["/regions=usgbnz", "elequint/0"], "Xtest.latin1.add", 'D')
mkspell! Xtest.latin1.add.spl Xtest.latin1.add
call assert_match('Invalid region nr in Xtest.latin1.add line 2: 0', execute('messages'))
- call delete('Xtest.latin1.add')
call delete('Xtest.latin1.add.spl')
endfunc