From 45bbaef0382c5468d9fac511775bd99ea7bf5b84 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 8 Sep 2022 16:39:22 +0100 Subject: patch 9.0.0418: manually deleting temp test files Problem: Manually deleting temp test files. Solution: Use the 'D' flag of writefile() and mkdir(). --- src/testdir/test_channel.vim | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/testdir/test_channel.vim') diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 6b595d0a33..930868f511 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -714,7 +714,7 @@ func Stop_g_job() endfunc func Test_nl_read_file() - call writefile(['echo something', 'echoerr wrong', 'double this'], 'Xinput') + call writefile(['echo something', 'echoerr wrong', 'double this'], 'Xinput', 'D') let g:job = job_start(s:python . " test_channel_pipe.py", \ {'in_io': 'file', 'in_name': 'Xinput'}) call assert_equal("run", job_status(g:job)) @@ -726,7 +726,6 @@ func Test_nl_read_file() call assert_equal("AND this", ch_readraw(handle)) finally call Stop_g_job() - call delete('Xinput') endtry call assert_fails("echo ch_read(test_null_channel(), {'callback' : 'abc'})", 'E475:') endfunc @@ -1161,14 +1160,13 @@ func Test_write_to_buffer_and_scroll() endif call job_start(cmd, #{out_io: 'buffer', out_name: 'Xscrollbuffer'}) END - call writefile(lines, 'XtestBufferScroll') + call writefile(lines, 'XtestBufferScroll', 'D') let buf = RunVimInTerminal('-S XtestBufferScroll', #{rows: 10}) call TermWait(buf, 50) call VerifyScreenDump(buf, 'Test_job_buffer_scroll_1', {}) " clean up call StopVimInTerminal(buf) - call delete('XtestBufferScroll') endfunc func Test_pipe_null() @@ -2178,7 +2176,7 @@ endfunc func Test_job_tty_in_out() CheckUnix - call writefile(['test'], 'Xtestin') + call writefile(['test'], 'Xtestin', 'D') let in_opts = [{}, \ {'in_io': 'null'}, \ {'in_io': 'file', 'in_name': 'Xtestin'}] @@ -2220,7 +2218,6 @@ func Test_job_tty_in_out() call WaitForAssert({-> assert_equal('dead', job_status(job))}) endfor - call delete('Xtestin') call delete('Xtestout') call delete('Xtesterr') endfunc @@ -2281,9 +2278,9 @@ func Test_zz_ch_log() let text = readfile('Xlog') call assert_match("hello there", text[1]) call assert_match("%s%s", text[2]) - call mkdir("Xchlogdir1") + call mkdir("Xchlogdir1", 'D') call assert_fails("call ch_logfile('Xchlogdir1')", 'E484:') - cal delete("Xchlogdir1", 'd') + call delete('Xlog') endfunc -- cgit v1.2.3