diff src/testdir/test_autocmd.vim @ 10086:1de911ef1edf v7.4.2314

commit https://github.com/vim/vim/commit/de653f08805dde14424d417502a0480a6ad292f8 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 3 16:59:06 2016 +0200 patch 7.4.2314 Problem: No error when deleting an augroup while it's the current one. Solution: Disallow deleting an augroup when it's the current one.
author Christian Brabandt <cb@256bit.org>
date Sat, 03 Sep 2016 17:00:07 +0200
parents 3e410e6e1986
children 58e6dd1d8be3
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -182,13 +182,17 @@ func Test_augroup_warning()
   doautocmd VimEnter
   redir END
   call assert_true(match(res, "W19:") < 0)
+  au! VimEnter
 endfunc
 
 func Test_augroup_deleted()
-  " This caused a crash
+  " This caused a crash before E936 was introduced
   augroup x
+    call assert_fails('augroup! x', 'E936:')
+    au VimEnter * echo
+  augroup end
   augroup! x
-  au VimEnter * echo
-  au VimEnter
+  call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
+  au! VimEnter
 endfunc