1
0
forked from aniani/vim

patch 9.0.0719: 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-10-10 22:39:42 +01:00
parent ccf2837a05
commit 56564964e6
22 changed files with 150 additions and 282 deletions

View File

@@ -1,7 +1,7 @@
" Test for the :scriptnames command
func Test_scriptnames()
call writefile(['let did_load_script = 123'], 'Xscripting')
call writefile(['let did_load_script = 123'], 'Xscripting', 'D')
source Xscripting
call assert_equal(123, g:did_load_script)
@@ -22,7 +22,6 @@ func Test_scriptnames()
call assert_equal('Xscripting', expand('%:t'))
bwipe
call delete('Xscripting')
let msgs = execute('messages')
scriptnames
@@ -47,7 +46,7 @@ func Test_getscriptinfo()
def Xscript_def_func2()
enddef
END
call writefile(lines, 'X22script91')
call writefile(lines, 'X22script91', 'D')
source X22script91
let l = getscriptinfo()
call assert_match('X22script91$', l[-1].name)
@@ -92,8 +91,6 @@ func Test_getscriptinfo()
call assert_fails("echo getscriptinfo('foobar')", 'E1206:')
call assert_fails("echo getscriptinfo({'sid': []})", 'E745:')
call delete('X22script91')
endfunc
" vim: shiftwidth=2 sts=2 expandtab