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