From 0cc41a61d1ac504bae4975021b95ce133268ce1a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 25 Jul 2022 08:36:48 +0800 Subject: test: improve some input tests --- test/functional/terminal/tui_spec.lua | 7 +++++-- test/functional/ui/mouse_spec.lua | 12 +++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index dd88379344..bcd7ae50c8 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -436,8 +436,11 @@ describe('TUI', function() | {3:-- TERMINAL --} | ]]) - feed_data(':tab split\r:tabnew\r') - feed_data(':highlight Tabline ctermbg=NONE ctermfg=NONE cterm=underline\r') + child_session:request('nvim_command', [[ + tab split + tabnew + highlight Tabline ctermbg=NONE ctermfg=NONE cterm=underline + ]]) local attrs = screen:get_default_attr_ids() attrs[11] = {underline = true} screen:expect([[ diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 7305bd589b..e389b7ab89 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -1572,23 +1572,17 @@ describe('ui/mouse/input', function() meths.input_mouse('left', 'release', '', 0, 0, 0) end) - it('scroll keys are not translated into multiclicks #6211 #6989', function() + it('scroll keys are not translated into multiclicks and can be mapped #6211 #6989', function() meths.set_var('mouse_up', 0) meths.set_var('mouse_up2', 0) - meths.set_var('mouse_up3', 0) - meths.set_var('mouse_up4', 0) command('nnoremap let g:mouse_up += 1') command('nnoremap <2-ScrollWheelUp> let g:mouse_up2 += 1') - command('nnoremap <3-ScrollWheelUp> let g:mouse_up3 += 1') - command('nnoremap <4-ScrollWheelUp> let g:mouse_up4 += 1') - meths.input_mouse('wheel', 'up', '', 0, 0, 0) - meths.input_mouse('wheel', 'up', '', 0, 0, 0) + feed('<0,0>') + feed('<0,0>') meths.input_mouse('wheel', 'up', '', 0, 0, 0) meths.input_mouse('wheel', 'up', '', 0, 0, 0) eq(4, meths.get_var('mouse_up')) eq(0, meths.get_var('mouse_up2')) - eq(0, meths.get_var('mouse_up3')) - eq(0, meths.get_var('mouse_up4')) end) it('feeding does not use uninitialized memory #19480', function() -- cgit