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

@@ -51,12 +51,10 @@ endfunc
" When deleting a file and immediately creating a new one the inode may be
" recycled. Vim should not recognize it as the same script.
func Test_different_script()
call writefile(['let s:var = "asdf"'], 'XoneScript')
call writefile(['let s:var = "asdf"'], 'XoneScript', 'D')
source XoneScript
call delete('XoneScript')
call writefile(['let g:var = s:var'], 'XtwoScript')
call writefile(['let g:var = s:var'], 'XtwoScript', 'D')
call assert_fails('source XtwoScript', 'E121:')
call delete('XtwoScript')
endfunc
" When sourcing a vim script, shebang should be ignored.