diff src/testdir/test_let.vim @ 30580:f08ed0738f7a v9.0.0625

patch 9.0.0625: too many delete() calls in tests Commit: https://github.com/vim/vim/commit/7dd5a78b88af7734bdbf236fdfafb49f27a0ca2e Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 29 21:01:57 2022 +0100 patch 9.0.0625: 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 Thu, 29 Sep 2022 22:15:04 +0200
parents bbcdc76dcd71
children a09404dad917
line wrap: on
line diff
--- a/src/testdir/test_let.vim
+++ b/src/testdir/test_let.vim
@@ -344,36 +344,31 @@ func Test_let_heredoc_fails()
     let v =<< that there
   endfunc
   END
-  call writefile(text, 'XheredocFail')
+  call writefile(text, 'XheredocFail', 'D')
   call assert_fails('source XheredocFail', 'E1145:')
-  call delete('XheredocFail')
 
   let text =<< trim CodeEnd
   func MissingEnd()
     let v =<< END
   endfunc
   CodeEnd
-  call writefile(text, 'XheredocWrong')
+  call writefile(text, 'XheredocWrong', 'D')
   call assert_fails('source XheredocWrong', 'E1145:')
-  call delete('XheredocWrong')
 
   let text =<< trim TEXTend
     let v =<< " comment
   TEXTend
-  call writefile(text, 'XheredocNoMarker')
+  call writefile(text, 'XheredocNoMarker', 'D')
   call assert_fails('source XheredocNoMarker', 'E172:')
-  call delete('XheredocNoMarker')
 
   let text =<< trim TEXTend
     let v =<< text
   TEXTend
-  call writefile(text, 'XheredocBadMarker')
+  call writefile(text, 'XheredocBadMarker', 'D')
   call assert_fails('source XheredocBadMarker', 'E221:')
-  call delete('XheredocBadMarker')
 
-  call writefile(['let v =<< TEXT', 'abc'], 'XheredocMissingMarker')
+  call writefile(['let v =<< TEXT', 'abc'], 'XheredocMissingMarker', 'D')
   call assert_fails('source XheredocMissingMarker', 'E990:')
-  call delete('XheredocMissingMarker')
 endfunc
 
 func Test_let_heredoc_trim_no_indent_marker()