From 56564964e6d0956c29687e8a10cb94fe42f5c097 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Mon, 10 Oct 2022 22:39:42 +0100 Subject: patch 9.0.0719: too many delete() calls in tests Problem: Too many delete() calls in tests. Solution: Use deferred delete where possible. --- src/testdir/test_startup_utf8.vim | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/testdir/test_startup_utf8.vim') diff --git a/src/testdir/test_startup_utf8.vim b/src/testdir/test_startup_utf8.vim index 33f50a9cfe..e8b99e7937 100644 --- a/src/testdir/test_startup_utf8.vim +++ b/src/testdir/test_startup_utf8.vim @@ -6,7 +6,7 @@ source screendump.vim 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 @@ func Test_read_stdin_utf8() else call assert_equal('', 'RunVimPiped failed.') endif + call delete('Xtestout') - call delete('Xtestin') endfunc func Test_read_fifo_utf8() @@ -41,7 +41,7 @@ func Test_read_fifo_utf8() 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 @@ func Test_read_fifo_utf8() else call assert_equal('', 'RunVim failed.') endif + call delete('Xtestout') - call delete('Xtestin') endfunc func Test_detect_ambiwidth() @@ -69,14 +69,13 @@ func Test_detect_ambiwidth() \ '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\=&ambiwidth\\") call WaitForAssert({-> assert_match('single', term_getline(buf, 1))}) call StopVimInTerminal(buf) - call delete('Xscript') endfunc " vim: shiftwidth=2 sts=2 expandtab -- cgit v1.2.3