1
0
forked from aniani/vim

patch 9.0.0625: 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:01:57 +01:00
parent ac38ec7c7f
commit 7dd5a78b88
10 changed files with 47 additions and 80 deletions

View File

@@ -817,8 +817,7 @@ endfunc
" Test :luafile foo.lua
func Test_luafile()
call delete('Xlua_file')
call writefile(["str = 'hello'", "num = 123" ], 'Xlua_file')
call writefile(["str = 'hello'", "num = 123" ], 'Xlua_file', 'D')
call setfperm('Xlua_file', 'r-xr-xr-x')
luafile Xlua_file
@@ -826,7 +825,6 @@ func Test_luafile()
call assert_equal(123, luaeval('num'))
lua str, num = nil
call delete('Xlua_file')
endfunc
" Test :luafile %
@@ -849,12 +847,11 @@ endfunc
" Test :luafile with syntax error
func Test_luafile_error()
new Xlua_file
call writefile(['nil = 0' ], 'Xlua_file')
call writefile(['nil = 0' ], 'Xlua_file', 'D')
call setfperm('Xlua_file', 'r-xr-xr-x')
call assert_fails('luafile Xlua_file', "Xlua_file:1: unexpected symbol near 'nil'")
call delete('Xlua_file')
bwipe!
endfunc