diff options
Diffstat (limited to 'test/functional/lua/ui_event_spec.lua')
-rw-r--r-- | test/functional/lua/ui_event_spec.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 57ffcf7b4e..6481da900e 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -117,4 +117,31 @@ describe('vim.ui_attach', function() }) eq(0, helpers.eval('v:shell_error')) end) + + it('can receive accurate message kinds even if they are history', function() + exec_lua([[ + vim.cmd.echomsg("'message1'") + print('message2') + vim.ui_attach(ns, { ext_messages = true }, on_event) + vim.cmd.echomsg("'message3'") + ]]) + feed(':messages<cr>') + feed('<cr>') + + local actual = exec_lua([[ + return vim.tbl_filter(function (event) + return event[1] == "msg_history_show" + end, events) + ]]) + eq({ + { + 'msg_history_show', + { + { 'echomsg', { { 0, 'message1' } } }, + { '', { { 0, 'message2' } } }, + { 'echomsg', { { 0, 'message3' } } }, + }, + }, + }, actual, inspect(actual)) + end) end) |