diff src/testdir/test_statusline.vim @ 30769:ae10b91ac6b3 v9.0.0719

patch 9.0.0719: too many delete() calls in tests Commit: https://github.com/vim/vim/commit/56564964e6d0956c29687e8a10cb94fe42f5c097 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Oct 10 22:39:42 2022 +0100 patch 9.0.0719: too many delete() calls in tests Problem: Too many delete() calls in tests. Solution: Use deferred delete where possible.
author Bram Moolenaar <Bram@vim.org>
date Mon, 10 Oct 2022 23:45:04 +0200
parents 5da38c4ffe92
children bb797331e21b
line wrap: on
line diff
--- a/src/testdir/test_statusline.vim
+++ b/src/testdir/test_statusline.vim
@@ -470,14 +470,13 @@ func Test_statusline_removed_group()
     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 @@ func Test_statusline_using_mode()
     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 @@ func Test_statusline_using_mode()
   " 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 @@ func Test_statusline_highlight_truncate(
     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