mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
test: add a Lua functional test for NoName buffer event order
This commit is contained in:
parent
f531fb97ff
commit
e69cb86750
@ -60,6 +60,23 @@ describe('autocmd', function()
|
|||||||
eq(expected, eval('g:evs'))
|
eq(expected, eval('g:evs'))
|
||||||
end)
|
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()
|
it('WinClosed is non-recursive', function()
|
||||||
command('let g:triggered = 0')
|
command('let g:triggered = 0')
|
||||||
command('autocmd WinClosed * :let g:triggered+=1 | :bdelete 2')
|
command('autocmd WinClosed * :let g:triggered+=1 | :bdelete 2')
|
||||||
|
Loading…
Reference in New Issue
Block a user