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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user