comparison src/testdir/test_autocmd.vim @ 9682:a98607bb756c v7.4.2117

commit https://github.com/vim/vim/commit/f2c4c391192cab6e923b1a418d4af09106fba25f Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jul 29 20:50:24 2016 +0200 patch 7.4.2117 Problem: Deleting an augroup that still has autocmds does not give a warning. The next defined augroup takes its place. Solution: Give a warning and prevent the index being used for another group name.
author Christian Brabandt <cb@256bit.org>
date Fri, 29 Jul 2016 21:00:08 +0200
parents 01c9630e80e0
children 65e43481d7de
comparison
equal deleted inserted replaced
9681:488769b5d3a1 9682:a98607bb756c
149 " test that a bar is recognized after the {group} 149 " test that a bar is recognized after the {group}
150 call s:AddAnAutocmd() 150 call s:AddAnAutocmd()
151 au! vimBarTest|echo 'hello' 151 au! vimBarTest|echo 'hello'
152 call assert_equal(1, len(split(execute('au vimBarTest'), "\n"))) 152 call assert_equal(1, len(split(execute('au vimBarTest'), "\n")))
153 endfunc 153 endfunc
154
155 func Test_augroup_warning()
156 augroup TheWarning
157 au VimEnter * echo 'entering'
158 augroup END
159 call assert_true(match(execute('au VimEnter'), "TheWarning.*VimEnter") >= 0)
160 redir => res
161 augroup! TheWarning
162 redir END
163 call assert_true(match(res, "W19:") >= 0)
164 call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
165
166 " check "Another" does not take the pace of the deleted entry
167 augroup Another
168 augroup END
169 call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0)
170 endfunc