summaryrefslogtreecommitdiff
path: root/src/testdir/test_autocmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-11 22:14:59 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-11 22:14:59 +0200
commit9b7bf9e98f06ece595fed7a3ff53ecce89797a53 (patch)
tree4a9b2cd5ac2f18f3c2c017530ab95f6878f1e757 /src/testdir/test_autocmd.vim
parent914e7eaa67f8d816e15fb4a1180e6bece88d9742 (diff)
downloadvim-git-9b7bf9e98f06ece595fed7a3ff53ecce89797a53.tar.gz
patch 8.2.1183: assert_fails() checks the last error messagev8.2.1183
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.
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r--src/testdir/test_autocmd.vim12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 446d22bd7..c167ed951 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -168,9 +168,7 @@ func Test_autocmd_bufunload_avoiding_SEGV_01()
exe 'autocmd BufUnload <buffer> ' . (lastbuf + 1) . 'bwipeout!'
augroup END
- " Todo: check for E937 generated first
- " call assert_fails('edit bb.txt', 'E937:')
- call assert_fails('edit bb.txt', 'E517:')
+ call assert_fails('edit bb.txt', ['E937:', 'E517:'])
autocmd! test_autocmd_bufunload
augroup! test_autocmd_bufunload
@@ -1745,9 +1743,7 @@ endfunc
func Test_nocatch_wipe_all_buffers()
" Real nasty autocommand: wipe all buffers on any event.
au * * bwipe *
- " Get E93 first?
- " call assert_fails('next x', 'E93:')
- call assert_fails('next x', 'E517:')
+ call assert_fails('next x', ['E94:', 'E517:'])
bwipe
au!
endfunc
@@ -1756,7 +1752,7 @@ func Test_nocatch_wipe_dummy_buffer()
if has('quickfix')
" Nasty autocommand: wipe buffer on any event.
au * x bwipe
- call assert_fails('lv½ /x', 'E480')
+ call assert_fails('lv½ /x', 'E937')
au!
endif
endfunc
@@ -2570,7 +2566,7 @@ func Test_BufDelete_changebuf()
augroup END
let save_cpo = &cpo
set cpo+=f
- call assert_fails('r Xfile', 'E484:')
+ call assert_fails('r Xfile', ['E812:', 'E484:'])
call assert_equal('somefile', @%)
let &cpo = save_cpo
augroup TestAuCmd