diff options
Diffstat (limited to 'test/functional')
| -rw-r--r-- | test/functional/autocmd/autocmd_spec.lua | 11 | ||||
| -rw-r--r-- | test/functional/ui/tabline_spec.lua | 43 |
2 files changed, 51 insertions, 3 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua index e62d3bb66b..93d71a9e45 100644 --- a/test/functional/autocmd/autocmd_spec.lua +++ b/test/functional/autocmd/autocmd_spec.lua @@ -101,6 +101,17 @@ describe('autocmd', function() }, eval('g:evs')) end) + it('WinClosed from root directory', function() + command('cd /') + command('let g:evs = []') + command('autocmd WinClosed * :call add(g:evs, ["WinClosed", expand("<afile>")])') + command('new') + command('close') + eq({ + {'WinClosed', '1001'}, + }, eval('g:evs')) + end) + it('v:vim_did_enter is 1 after VimEnter', function() eq(1, eval('v:vim_did_enter')) end) diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index 23aae81745..ab8d63cda1 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -4,14 +4,17 @@ local clear, command, eq = helpers.clear, helpers.command, helpers.eq describe('ui/ext_tabline', function() local screen - local event_tabs, event_curtab + local event_tabs, event_curtab, event_curbuf, event_buffers before_each(function() clear() screen = Screen.new(25, 5) screen:attach({rgb=true, ext_tabline=true}) - function screen:_handle_tabline_update(curtab, tabs) - event_curtab, event_tabs = curtab, tabs + function screen:_handle_tabline_update(curtab, tabs, curbuf, buffers) + event_curtab = curtab + event_tabs = tabs + event_curbuf = curbuf + event_buffers = buffers end end) @@ -45,4 +48,38 @@ describe('ui/ext_tabline', function() eq(expected_tabs, event_tabs) end} end) + + it('buffer UI events', function() + local expected_buffers_initial= { + {buffer = { id = 1 }, name = '[No Name]'}, + } + + screen:expect{grid=[[ + ^ | + ~ | + ~ | + ~ | + | + ]], condition=function() + eq({ id = 1}, event_curbuf) + eq(expected_buffers_initial, event_buffers) + end} + + command("badd another-buffer") + command("bnext") + + local expected_buffers = { + {buffer = { id = 2 }, name = 'another-buffer'}, + } + screen:expect{grid=[[ + ^ | + ~ | + ~ | + ~ | + | + ]], condition=function() + eq({ id = 2 }, event_curbuf) + eq(expected_buffers, event_buffers) + end} + end) end) |