Mercurial > vim
diff src/testdir/test_python3.vim @ 30592:457ea0570b6f v9.0.0631
patch 9.0.0631: too many delete() calls in tests
Commit: https://github.com/vim/vim/commit/145d1fd91041bd2a22a11eef0357702e420796e2
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Sep 30 21:57:11 2022 +0100
patch 9.0.0631: too many delete() calls in tests
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 30 Sep 2022 23:00:10 +0200 |
parents | 029c59bf78f1 |
children | c3c8136ecfa0 |
line wrap: on
line diff
--- a/src/testdir/test_python3.vim +++ b/src/testdir/test_python3.vim @@ -4044,7 +4044,7 @@ func Test_python3_fold_hidden_buffer() endfunc call setline(1, repeat([''], 15) + repeat(['from'], 3)) - eval repeat(['x'], 17)->writefile('Xa.txt') + eval repeat(['x'], 17)->writefile('Xa.txt', 'D') split Xa.txt py3 import vim py3 b = vim.current.buffer @@ -4052,7 +4052,6 @@ func Test_python3_fold_hidden_buffer() hide py3 b[:] = aaa - call delete('Xa.txt') set fdm& fde& delfunc Fde bwipe! Xa.txt @@ -4078,7 +4077,7 @@ func Test_python3_hidden_buf_mod_does_no norm! Gzb call feedkeys(":call Func()\r", 'n') END - call writefile(lines, testfile) + call writefile(lines, testfile, 'D') let rows = 10 let bufnr = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows}) @@ -4090,8 +4089,8 @@ func Test_python3_hidden_buf_mod_does_no call term_sendkeys(bufnr, ":qall!\<CR>") call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(bufnr)))}) + exe bufnr . 'bwipe!' - call delete(testfile) endfunc " vim: shiftwidth=2 sts=2 expandtab