forked from aniani/vim
patch 8.2.1183: assert_fails() checks the last error message
Problem: assert_fails() checks the last error message.
Solution: Check the first error, it is more relevant. Fix all the tests
that rely on the old behavior.
This commit is contained in:
@@ -855,7 +855,7 @@ func Test_cmdline_search_range()
|
||||
call assert_equal('B', getline(2))
|
||||
|
||||
let @/ = 'apple'
|
||||
call assert_fails('\/print', 'E486:')
|
||||
call assert_fails('\/print', ['E486:.*apple'])
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
@@ -972,7 +972,7 @@ func Test_verbosefile()
|
||||
call assert_match("foo\nbar", join(log, "\n"))
|
||||
call delete('Xlog')
|
||||
call mkdir('Xdir')
|
||||
call assert_fails('set verbosefile=Xdir', 'E474:')
|
||||
call assert_fails('set verbosefile=Xdir', ['E484:.*Xdir', 'E474:'])
|
||||
call delete('Xdir', 'd')
|
||||
endfunc
|
||||
|
||||
@@ -1208,7 +1208,7 @@ func Test_cmdwin_jump_to_win()
|
||||
call assert_fails('call feedkeys("q:\<C-W>\<C-W>\<CR>", "xt")', 'E11:')
|
||||
new
|
||||
set modified
|
||||
call assert_fails('call feedkeys("q/:qall\<CR>", "xt")', 'E162:')
|
||||
call assert_fails('call feedkeys("q/:qall\<CR>", "xt")', ['E37:', 'E162:'])
|
||||
close!
|
||||
call feedkeys("q/:close\<CR>", "xt")
|
||||
call assert_equal(1, winnr('$'))
|
||||
|
||||
Reference in New Issue
Block a user