aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/ui_spec.lua
diff options
context:
space:
mode:
authorRui Abreu Ferreira <raf-ep@gmx.com>2017-06-21 16:59:52 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-09-12 15:52:54 -0700
commite9cf515888705640ebd754483349f2bf84c32255 (patch)
treea8709dfdb9e5e6090b47fc601e6bc21350f78fac /test/functional/api/ui_spec.lua
parent426399c2c4dd325bf00ffe1f410c1b9fd5053692 (diff)
downloadrneovim-e9cf515888705640ebd754483349f2bf84c32255.tar.gz
rneovim-e9cf515888705640ebd754483349f2bf84c32255.tar.bz2
rneovim-e9cf515888705640ebd754483349f2bf84c32255.zip
UIAttach, UIDetach
Diffstat (limited to 'test/functional/api/ui_spec.lua')
-rw-r--r--test/functional/api/ui_spec.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/api/ui_spec.lua b/test/functional/api/ui_spec.lua
index 2758da6a1f..bedc381b70 100644
--- a/test/functional/api/ui_spec.lua
+++ b/test/functional/api/ui_spec.lua
@@ -6,6 +6,7 @@ local eval = helpers.eval
local meths = helpers.meths
local request = helpers.request
local pcall_err = helpers.pcall_err
+local command = helpers.command
describe('nvim_ui_attach()', function()
before_each(function()
@@ -34,4 +35,13 @@ describe('nvim_ui_attach()', function()
eq('UI already attached to channel: 1',
pcall_err(request, 'nvim_ui_attach', 40, 10, { rgb=false }))
end)
+ it('autocmds UIAttach/Detach set v:event', function()
+ local screen = Screen.new()
+ command('autocmd UIAttach * :let g:ui_attach_v_event = deepcopy(v:event)')
+ command('autocmd UIDetach * :let g:ui_detach_v_event = deepcopy(v:event)')
+ screen:attach()
+ assert.same({chan=1}, eval('g:ui_attach_v_event'))
+ screen:detach()
+ assert.same({chan=1}, eval('g:ui_detach_v_event'))
+ end)
end)