patch 9.0.0626: 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_memory_usage.vim b/src/testdir/test_memory_usage.vim
index 976fcde..13e7eec 100644
--- a/src/testdir/test_memory_usage.vim
+++ b/src/testdir/test_memory_usage.vim
@@ -92,7 +92,7 @@
call s:f(0)
endfor
END
- call writefile(lines, testfile)
+ call writefile(lines, testfile, 'D')
let vim = s:vim_new()
call vim.start('--clean', '-c', 'set noswapfile', testfile)
@@ -114,7 +114,6 @@
call assert_inrange(lower, upper, after.max)
call vim.stop()
- call delete(testfile)
endfunc
func Test_memory_func_capture_lvars()
@@ -130,7 +129,7 @@
call s:f()
endfor
END
- call writefile(lines, testfile)
+ call writefile(lines, testfile, 'D')
let vim = s:vim_new()
call vim.start('--clean', '-c', 'set noswapfile', testfile)
@@ -161,7 +160,6 @@
call assert_inrange(lower, upper, last)
call vim.stop()
- call delete(testfile)
endfunc
" vim: shiftwidth=2 sts=2 expandtab