Mercurial > vim
diff src/testdir/test_stat.vim @ 30769:ae10b91ac6b3 v9.0.0719
patch 9.0.0719: too many delete() calls in tests
Commit: https://github.com/vim/vim/commit/56564964e6d0956c29687e8a10cb94fe42f5c097
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 10 22:39:42 2022 +0100
patch 9.0.0719: 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 | Mon, 10 Oct 2022 23:45:04 +0200 |
parents | 13b02c1ea0f7 |
children |
line wrap: on
line diff
--- a/src/testdir/test_stat.vim +++ b/src/testdir/test_stat.vim @@ -63,7 +63,7 @@ func Test_checktime() let fname = 'Xtest.tmp' let fl = ['Hello World!'] - call writefile(fl, fname) + call writefile(fl, fname, 'D') set autoread exec 'e' fname call SleepForTimestamp() @@ -72,8 +72,6 @@ func Test_checktime() call writefile(fl, fname) checktime call assert_equal(fl[0], getline(1)) - - call delete(fname) endfunc func Test_checktime_fast() @@ -82,7 +80,7 @@ func Test_checktime_fast() let fname = 'Xtest.tmp' let fl = ['Hello World!'] - call writefile(fl, fname) + call writefile(fl, fname, 'D') set autoread exec 'e' fname let fl = readfile(fname) @@ -90,8 +88,6 @@ func Test_checktime_fast() call writefile(fl, fname) checktime call assert_equal(fl[0], getline(1)) - - call delete(fname) endfunc func Test_autoread_fast() @@ -105,12 +101,10 @@ func Test_autoread_fast() call setline(1, 'foo') w! sleep 10m - call writefile(['bar'], 'Xautoread') + call writefile(['bar'], 'Xautoread', 'D') sleep 10m checktime call assert_equal('bar', trim(getline(1))) - - call delete('Xautoread') endfunc func Test_autoread_file_deleted()