• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Révisionffb173dbf2287dcfec0d931518fc35e547b7f54a (tree)
l'heure2020-11-25 22:30:05
AuteurBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Message de Log

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)

Change Summary

Modification

diff -r 8a52dc676c59 -r ffb173dbf228 src/testdir/test_autocmd.vim
--- a/src/testdir/test_autocmd.vim Wed Nov 25 14:00:04 2020 +0100
+++ b/src/testdir/test_autocmd.vim Wed Nov 25 14:30:05 2020 +0100
@@ -300,28 +300,28 @@
300300 augroup TheWarning
301301 au VimEnter * echo 'entering'
302302 augroup END
303- call assert_true(match(execute('au VimEnter'), "TheWarning.*VimEnter") >= 0)
303+ call assert_match("TheWarning.*VimEnter", execute('au VimEnter'))
304304 redir => res
305305 augroup! TheWarning
306306 redir END
307- call assert_true(match(res, "W19:") >= 0)
308- call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
307+ call assert_match("W19:", res)
308+ call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
309309
310310 " check "Another" does not take the pace of the deleted entry
311311 augroup Another
312312 augroup END
313- call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
313+ call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
314314 augroup! Another
315315
316316 " no warning for postpone aucmd delete
317317 augroup StartOK
318318 au VimEnter * call RemoveGroup()
319319 augroup END
320- call assert_true(match(execute('au VimEnter'), "StartOK.*VimEnter") >= 0)
320+ call assert_match("StartOK.*VimEnter", execute('au VimEnter'))
321321 redir => res
322322 doautocmd VimEnter
323323 redir END
324- call assert_true(match(res, "W19:") < 0)
324+ call assert_notmatch("W19:", res)
325325 au! VimEnter
326326
327327 call assert_fails('augroup!', 'E471:')
@@ -351,7 +351,7 @@
351351 au VimEnter * echo
352352 augroup end
353353 augroup! x
354- call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
354+ call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
355355 au! VimEnter
356356 endfunc
357357
diff -r 8a52dc676c59 -r ffb173dbf228 src/testdir/test_backspace_opt.vim
--- a/src/testdir/test_backspace_opt.vim Wed Nov 25 14:00:04 2020 +0100
+++ b/src/testdir/test_backspace_opt.vim Wed Nov 25 14:30:05 2020 +0100
@@ -1,15 +1,5 @@
11 " Tests for 'backspace' settings
22
3-func Exec(expr)
4- let str=''
5- try
6- exec a:expr
7- catch /.*/
8- let str=v:exception
9- endtry
10- return str
11-endfunc
12-
133 func Test_backspace_option()
144 set backspace=
155 call assert_equal('', &backspace)
@@ -41,10 +31,10 @@
4131 set backspace-=eol
4232 call assert_equal('', &backspace)
4333 " Check the error
44- call assert_equal(0, match(Exec('set backspace=ABC'), '.*E474:'))
45- call assert_equal(0, match(Exec('set backspace+=def'), '.*E474:'))
34+ call assert_fails('set backspace=ABC', 'E474:')
35+ call assert_fails('set backspace+=def', 'E474:')
4636 " NOTE: Vim doesn't check following error...
47- "call assert_equal(0, match(Exec('set backspace-=ghi'), '.*E474:'))
37+ "call assert_fails('set backspace-=ghi', 'E474:')
4838
4939 " Check backwards compatibility with version 5.4 and earlier
5040 set backspace=0
@@ -55,8 +45,8 @@
5545 call assert_equal('2', &backspace)
5646 set backspace=3
5747 call assert_equal('3', &backspace)
58- call assert_false(match(Exec('set backspace=4'), '.*E474:'))
59- call assert_false(match(Exec('set backspace=10'), '.*E474:'))
48+ call assert_fails('set backspace=4', 'E474:')
49+ call assert_fails('set backspace=10', 'E474:')
6050
6151 " Cleared when 'compatible' is set
6252 set compatible
diff -r 8a52dc676c59 -r ffb173dbf228 src/version.c
--- a/src/version.c Wed Nov 25 14:00:04 2020 +0100
+++ b/src/version.c Wed Nov 25 14:30:05 2020 +0100
@@ -751,6 +751,8 @@
751751 static int included_patches[] =
752752 { /* Add new patch number below this line */
753753 /**/
754+ 2046,
755+/**/
754756 2045,
755757 /**/
756758 2044,
Afficher sur ancien navigateur de dépôt.