patch 9.0.0719: too many delete() calls in tests
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
diff --git a/src/testdir/test_startup_utf8.vim b/src/testdir/test_startup_utf8.vim
index 33f50a9..e8b99e7 100644
--- a/src/testdir/test_startup_utf8.vim
+++ b/src/testdir/test_startup_utf8.vim
@@ -6,7 +6,7 @@
func Test_read_stdin_utf8()
let linesin = ['テスト', '€ÀÈÌÒÙ']
- call writefile(linesin, 'Xtestin')
+ call writefile(linesin, 'Xtestin', 'D')
let before = [
\ 'set enc=utf-8',
\ 'set fencs=cp932,utf-8',
@@ -26,8 +26,8 @@
else
call assert_equal('', 'RunVimPiped failed.')
endif
+
call delete('Xtestout')
- call delete('Xtestin')
endfunc
func Test_read_fifo_utf8()
@@ -41,7 +41,7 @@
throw 'Skipped: bash or zsh is required'
endif
let linesin = ['テスト', '€ÀÈÌÒÙ']
- call writefile(linesin, 'Xtestin')
+ call writefile(linesin, 'Xtestin', 'D')
let before = [
\ 'set enc=utf-8',
\ 'set fencs=cp932,utf-8',
@@ -56,8 +56,8 @@
else
call assert_equal('', 'RunVim failed.')
endif
+
call delete('Xtestout')
- call delete('Xtestin')
endfunc
func Test_detect_ambiwidth()
@@ -69,14 +69,13 @@
\ 'set ambiwidth=double',
\ 'call test_option_not_set("ambiwidth")',
\ 'redraw',
- \ ], 'Xscript')
+ \ ], 'Xscript', 'D')
let buf = RunVimInTerminal('-S Xscript', #{keep_t_u7: 1})
call TermWait(buf)
call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>")
call WaitForAssert({-> assert_match('single', term_getline(buf, 1))})
call StopVimInTerminal(buf)
- call delete('Xscript')
endfunc
" vim: shiftwidth=2 sts=2 expandtab