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_statusline.vim b/src/testdir/test_statusline.vim
index e60140f..15f2083 100644
--- a/src/testdir/test_statusline.vim
+++ b/src/testdir/test_statusline.vim
@@ -470,14 +470,13 @@
set laststatus=2
let &statusline = '%#StatColorHi2#%(✓%#StatColorHi2#%) Q≡'
END
- call writefile(lines, 'XTest_statusline')
+ call writefile(lines, 'XTest_statusline', 'D')
let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 10, 'cols': 50})
call VerifyScreenDump(buf, 'Test_statusline_1', {})
" clean up
call StopVimInTerminal(buf)
- call delete('XTest_statusline')
endfunc
func Test_statusline_using_mode()
@@ -488,7 +487,7 @@
split
setlocal statusline=+%{mode()}+
END
- call writefile(lines, 'XTest_statusline')
+ call writefile(lines, 'XTest_statusline', 'D')
let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 7, 'cols': 50})
call VerifyScreenDump(buf, 'Test_statusline_mode_1', {})
@@ -499,7 +498,6 @@
" clean up
call term_sendkeys(buf, "close\<CR>")
call StopVimInTerminal(buf)
- call delete('XTest_statusline')
endfunc
func Test_statusline_after_split_vsplit()
@@ -552,13 +550,12 @@
hi! link User2 ErrorMsg
set statusline=%.5(%1*ABC%2*DEF%1*GHI%)
END
- call writefile(lines, 'XTest_statusline')
+ call writefile(lines, 'XTest_statusline', 'D')
let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 6})
call VerifyScreenDump(buf, 'Test_statusline_hl', {})
call StopVimInTerminal(buf)
- call delete('XTest_statusline')
endfunc
" vim: shiftwidth=2 sts=2 expandtab