forked from aniani/vim
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)
This commit is contained in:
@@ -300,28 +300,28 @@ func Test_augroup_warning()
|
|||||||
augroup TheWarning
|
augroup TheWarning
|
||||||
au VimEnter * echo 'entering'
|
au VimEnter * echo 'entering'
|
||||||
augroup END
|
augroup END
|
||||||
call assert_true(match(execute('au VimEnter'), "TheWarning.*VimEnter") >= 0)
|
call assert_match("TheWarning.*VimEnter", execute('au VimEnter'))
|
||||||
redir => res
|
redir => res
|
||||||
augroup! TheWarning
|
augroup! TheWarning
|
||||||
redir END
|
redir END
|
||||||
call assert_true(match(res, "W19:") >= 0)
|
call assert_match("W19:", res)
|
||||||
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
|
call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
|
||||||
|
|
||||||
" check "Another" does not take the pace of the deleted entry
|
" check "Another" does not take the pace of the deleted entry
|
||||||
augroup Another
|
augroup Another
|
||||||
augroup END
|
augroup END
|
||||||
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
|
call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
|
||||||
augroup! Another
|
augroup! Another
|
||||||
|
|
||||||
" no warning for postpone aucmd delete
|
" no warning for postpone aucmd delete
|
||||||
augroup StartOK
|
augroup StartOK
|
||||||
au VimEnter * call RemoveGroup()
|
au VimEnter * call RemoveGroup()
|
||||||
augroup END
|
augroup END
|
||||||
call assert_true(match(execute('au VimEnter'), "StartOK.*VimEnter") >= 0)
|
call assert_match("StartOK.*VimEnter", execute('au VimEnter'))
|
||||||
redir => res
|
redir => res
|
||||||
doautocmd VimEnter
|
doautocmd VimEnter
|
||||||
redir END
|
redir END
|
||||||
call assert_true(match(res, "W19:") < 0)
|
call assert_notmatch("W19:", res)
|
||||||
au! VimEnter
|
au! VimEnter
|
||||||
|
|
||||||
call assert_fails('augroup!', 'E471:')
|
call assert_fails('augroup!', 'E471:')
|
||||||
@@ -351,7 +351,7 @@ func Test_augroup_deleted()
|
|||||||
au VimEnter * echo
|
au VimEnter * echo
|
||||||
augroup end
|
augroup end
|
||||||
augroup! x
|
augroup! x
|
||||||
call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
|
call assert_match("-Deleted-.*VimEnter", execute('au VimEnter'))
|
||||||
au! VimEnter
|
au! VimEnter
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
@@ -1,15 +1,5 @@
|
|||||||
" Tests for 'backspace' settings
|
" Tests for 'backspace' settings
|
||||||
|
|
||||||
func Exec(expr)
|
|
||||||
let str=''
|
|
||||||
try
|
|
||||||
exec a:expr
|
|
||||||
catch /.*/
|
|
||||||
let str=v:exception
|
|
||||||
endtry
|
|
||||||
return str
|
|
||||||
endfunc
|
|
||||||
|
|
||||||
func Test_backspace_option()
|
func Test_backspace_option()
|
||||||
set backspace=
|
set backspace=
|
||||||
call assert_equal('', &backspace)
|
call assert_equal('', &backspace)
|
||||||
@@ -41,10 +31,10 @@ func Test_backspace_option()
|
|||||||
set backspace-=eol
|
set backspace-=eol
|
||||||
call assert_equal('', &backspace)
|
call assert_equal('', &backspace)
|
||||||
" Check the error
|
" Check the error
|
||||||
call assert_equal(0, match(Exec('set backspace=ABC'), '.*E474:'))
|
call assert_fails('set backspace=ABC', 'E474:')
|
||||||
call assert_equal(0, match(Exec('set backspace+=def'), '.*E474:'))
|
call assert_fails('set backspace+=def', 'E474:')
|
||||||
" NOTE: Vim doesn't check following error...
|
" NOTE: Vim doesn't check following error...
|
||||||
"call assert_equal(0, match(Exec('set backspace-=ghi'), '.*E474:'))
|
"call assert_fails('set backspace-=ghi', 'E474:')
|
||||||
|
|
||||||
" Check backwards compatibility with version 5.4 and earlier
|
" Check backwards compatibility with version 5.4 and earlier
|
||||||
set backspace=0
|
set backspace=0
|
||||||
@@ -55,8 +45,8 @@ func Test_backspace_option()
|
|||||||
call assert_equal('2', &backspace)
|
call assert_equal('2', &backspace)
|
||||||
set backspace=3
|
set backspace=3
|
||||||
call assert_equal('3', &backspace)
|
call assert_equal('3', &backspace)
|
||||||
call assert_false(match(Exec('set backspace=4'), '.*E474:'))
|
call assert_fails('set backspace=4', 'E474:')
|
||||||
call assert_false(match(Exec('set backspace=10'), '.*E474:'))
|
call assert_fails('set backspace=10', 'E474:')
|
||||||
|
|
||||||
" Cleared when 'compatible' is set
|
" Cleared when 'compatible' is set
|
||||||
set compatible
|
set compatible
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2046,
|
||||||
/**/
|
/**/
|
||||||
2045,
|
2045,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user