Mercurial > vim
diff src/testdir/test_autocmd.vim @ 22999:ffb173dbf228 v8.2.2046
patch 8.2.2046: some test failures don't give a clear error
Commit: https://github.com/vim/vim/commit/5dc4e2f883896c99ebe83355822ac6067970b031
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Nov 25 14:15:12 2020 +0100
patch 8.2.2046: some test failures don't give a clear error
Problem: Some test failures don't give a clear error.
Solution: Use assert_match() and assert_fails() instead of assert_true().
(Ken Takata, closes #7368)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 25 Nov 2020 14:30:05 +0100 |
parents | f7f2d73ff85e |
children | d10a37eb91ee |
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -300,28 +300,28 @@ func Test_augroup_warning() augroup TheWarning au VimEnter * echo 'entering' augroup END - call assert_true(match(execute('au VimEnter'), "TheWarning.*VimEnter") >= 0) + call assert_match("TheWarning.*VimEnter", execute('au VimEnter')) redir => res augroup! TheWarning redir END - call assert_true(match(res, "W19:") >= 0) - call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) + call assert_match("W19:", res) + call assert_match("-Deleted-.*VimEnter", execute('au VimEnter')) " check "Another" does not take the pace of the deleted entry augroup Another augroup END - call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) + call assert_match("-Deleted-.*VimEnter", execute('au VimEnter')) augroup! Another " no warning for postpone aucmd delete augroup StartOK au VimEnter * call RemoveGroup() augroup END - call assert_true(match(execute('au VimEnter'), "StartOK.*VimEnter") >= 0) + call assert_match("StartOK.*VimEnter", execute('au VimEnter')) redir => res doautocmd VimEnter redir END - call assert_true(match(res, "W19:") < 0) + call assert_notmatch("W19:", res) au! VimEnter call assert_fails('augroup!', 'E471:') @@ -351,7 +351,7 @@ func Test_augroup_deleted() au VimEnter * echo augroup end augroup! x - call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) + call assert_match("-Deleted-.*VimEnter", execute('au VimEnter')) au! VimEnter endfunc