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.
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim
index eb213f1..539b782 100644
--- a/src/testdir/test_cmdline.vim
+++ b/src/testdir/test_cmdline.vim
@@ -855,7 +855,7 @@
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 @@
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 @@
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('$'))