aboutsummaryrefslogtreecommitdiff
path: root/test/functional/autocmd/autocmd_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/autocmd/autocmd_spec.lua')
-rw-r--r--test/functional/autocmd/autocmd_spec.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua
index f666f9cf75..814624d8e2 100644
--- a/test/functional/autocmd/autocmd_spec.lua
+++ b/test/functional/autocmd/autocmd_spec.lua
@@ -125,5 +125,23 @@ describe('autocmd', function()
command("put ='foo bar baz'")
feed('0llhlh')
eq(expected, eval('g:foo'))
+
+ --
+ -- :autocmd should not show empty section after ++once handlers expire.
+ --
+ expected = {
+ 'Once1',
+ 'Once2',
+ }
+ command('let g:foo = []')
+ command('autocmd! TabNew') -- Clear all TabNew handlers.
+ command('autocmd TabNew * ++once :call add(g:foo, "Once1")')
+ command('autocmd TabNew * ++once :call add(g:foo, "Once2")')
+ command('tabnew')
+ eq(expected, eval('g:foo'))
+ eq(dedent([[
+
+ --- Autocommands ---]]),
+ funcs.execute('autocmd Tabnew'))
end)
end)