1
0
forked from aniani/vim

patch 9.0.0626: too many delete() calls in tests

Problem:    Too many delete() calls in tests.
Solution:   Use deferred delete where possible.
This commit is contained in:
Bram Moolenaar
2022-09-29 21:37:33 +01:00
parent 7dd5a78b88
commit b152b6a40f
11 changed files with 52 additions and 96 deletions

View File

@@ -92,7 +92,7 @@ func Test_memory_func_capture_vargs()
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 @@ func Test_memory_func_capture_vargs()
call assert_inrange(lower, upper, after.max)
call vim.stop()
call delete(testfile)
endfunc
func Test_memory_func_capture_lvars()
@@ -130,7 +129,7 @@ func Test_memory_func_capture_lvars()
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 @@ func Test_memory_func_capture_lvars()
call assert_inrange(lower, upper, last)
call vim.stop()
call delete(testfile)
endfunc
" vim: shiftwidth=2 sts=2 expandtab