summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_autocmd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-03 16:59:06 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-03 16:59:06 +0200
commitde653f08805dde14424d417502a0480a6ad292f8 (patch)
tree455032d1febac1d084c69e3ca2cc7bb08b8def3b /src/testdir/test_autocmd.vim
parentb62cc36a600e2e1e5a1d1d484fef89898c847c4c (diff)
patch 7.4.2314v7.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.
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r--src/testdir/test_autocmd.vim10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 7d786c88cf..f05a55f1aa 100644
--- 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