aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-21 19:43:09 +0800
committerGitHub <noreply@github.com>2022-04-21 19:43:09 +0800
commite6dec30332f2538ae45d58e6bb674c8a28422fe9 (patch)
treefa4cdcbcd401c058af5811a17a7e0d0028847cc4 /test
parent5c4ec254784e7e92f61b69114c6091a198fe600f (diff)
parent5e9afca1c19914cdf6f81685c7950ab180278b1f (diff)
downloadrneovim-e6dec30332f2538ae45d58e6bb674c8a28422fe9.tar.gz
rneovim-e6dec30332f2538ae45d58e6bb674c8a28422fe9.tar.bz2
rneovim-e6dec30332f2538ae45d58e6bb674c8a28422fe9.zip
Merge pull request #18182 from zeertzjq/vim-8.2.2472
vim-patch:8.1.1756,8.2.{2472,2474,2475,2476,2477,4791,4802}: autocommand fixes
Diffstat (limited to 'test')
-rw-r--r--test/functional/autocmd/autocmd_spec.lua29
1 files changed, 17 insertions, 12 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua
index 6111654b5e..90254b7415 100644
--- a/test/functional/autocmd/autocmd_spec.lua
+++ b/test/functional/autocmd/autocmd_spec.lua
@@ -60,6 +60,23 @@ describe('autocmd', function()
eq(expected, eval('g:evs'))
end)
+ it('first edit causes BufUnload on NoName', function()
+ local expected = {
+ {'BufUnload', ''},
+ {'BufDelete', ''},
+ {'BufWipeout', ''},
+ {'BufEnter', 'testfile1'},
+ }
+ command('let g:evs = []')
+ command('autocmd BufEnter * :call add(g:evs, ["BufEnter", expand("<afile>")])')
+ command('autocmd BufDelete * :call add(g:evs, ["BufDelete", expand("<afile>")])')
+ command('autocmd BufLeave * :call add(g:evs, ["BufLeave", expand("<afile>")])')
+ command('autocmd BufUnload * :call add(g:evs, ["BufUnload", expand("<afile>")])')
+ command('autocmd BufWipeout * :call add(g:evs, ["BufWipeout", expand("<afile>")])')
+ command('edit testfile1')
+ eq(expected, eval('g:evs'))
+ end)
+
it('WinClosed is non-recursive', function()
command('let g:triggered = 0')
command('autocmd WinClosed * :let g:triggered+=1 | :bdelete 2')
@@ -548,18 +565,6 @@ describe('autocmd', function()
neq({}, meths.get_autocmds { group = "filetypedetect" })
end)
- it('should not access freed mem', function()
- source [[
- au BufEnter,BufLeave,WinEnter,WinLeave 0 vs xxx
- arg 0
- argadd
- all
- all
- au!
- bwipe xxx
- ]]
- end)
-
it('should allow comma-separated patterns', function()
source [[
augroup TestingPatterns