Mercurial > vim
diff src/testdir/test_assert.vim @ 30089:0a50e536de81
patch 9.0.0380: deleting files in tests is a hassle
Commit: https://github.com/vim/vim/commit/e1f3ab73bc7c4b3eee03b673c2983ed7eca6ea80
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 4 21:29:08 2022 +0100
patch 9.0.0380: deleting files in tests is a hassle
Problem: Deleting files in tests is a hassle.
Solution: Use the new 'D' flag of writefile().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 04 Sep 2022 22:30:03 +0200 |
parents | fd855ad74887 |
children | 5380551172aa |
line wrap: on
line diff
--- a/src/testdir/test_assert.vim +++ b/src/testdir/test_assert.vim @@ -89,12 +89,12 @@ func Test_assert_equalfile() call remove(v:errors, 0) let goodtext = ["one", "two", "three"] - call writefile(goodtext, 'Xone') + call writefile(goodtext, 'Xone', 'D') call assert_equal(1, 'Xone'->assert_equalfile('xyzxyz')) call assert_match("E485: Can't read file xyzxyz", v:errors[0]) call remove(v:errors, 0) - call writefile(goodtext, 'Xtwo') + call writefile(goodtext, 'Xtwo', 'D') call assert_equal(0, assert_equalfile('Xone', 'Xtwo')) call writefile([goodtext[0]], 'Xone') @@ -124,9 +124,6 @@ func Test_assert_equalfile() call assert_equal(1, assert_equalfile('Xone', 'Xtwo', 'a message')) call assert_match("a message: difference at byte 234, line 1 after", v:errors[0]) call remove(v:errors, 0) - - call delete('Xone') - call delete('Xtwo') endfunc func Test_assert_notequal()