aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Groves <charlie.groves@gmail.com>2022-03-23 15:14:44 -0400
committerzeertzjq <zeertzjq@outlook.com>2022-04-21 19:07:50 +0800
commite69cb86750d0e4b91d226e827d1eae2a98639777 (patch)
tree6c2b1a04dc7c724db240145e837d900341e683f6
parentf531fb97ff5009d2ac279a83da9b9e911c350c89 (diff)
downloadrneovim-e69cb86750d0e4b91d226e827d1eae2a98639777.tar.gz
rneovim-e69cb86750d0e4b91d226e827d1eae2a98639777.tar.bz2
rneovim-e69cb86750d0e4b91d226e827d1eae2a98639777.zip
test: add a Lua functional test for NoName buffer event order
-rw-r--r--test/functional/autocmd/autocmd_spec.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua
index b8d2c9ec1d..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')