patch 8.0.0861: still many old style tests
Problem: Still many old style tests.
Solution: Convert several tests to new style. (Yegappan Lakshmanan)
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 95b4cb9..dede9fa 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -613,3 +613,22 @@
call test_override('starting', 0)
"delfunc! AutoCommandOptionSet
endfunc
+
+" Test for Bufleave autocommand that deletes the buffer we are about to edit.
+func Test_BufleaveWithDelete()
+ new | edit Xfile1
+
+ augroup test_bufleavewithdelete
+ autocmd!
+ autocmd BufLeave Xfile1 bwipe Xfile2
+ augroup END
+
+ call assert_fails('edit Xfile2', 'E143:')
+ call assert_equal('Xfile1', bufname('%'))
+
+ autocmd! test_bufleavewithdelete BufLeave Xfile1
+ augroup! test_bufleavewithdelete
+
+ new
+ bwipe! Xfile1
+endfunc