mirror of
https://github.com/vim/vim.git
synced 2025-10-16 07:24:23 -04:00
patch 9.0.0968: GUI mouse event test is a bit flaky
Problem: GUI mouse event test is a bit flaky. Solution: Mark the test case as flaky. Move test function failure checks to a separate test function.
This commit is contained in:
@@ -904,13 +904,17 @@ endfunc
|
|||||||
|
|
||||||
" Test GUI mouse events
|
" Test GUI mouse events
|
||||||
func Test_gui_mouse_event()
|
func Test_gui_mouse_event()
|
||||||
|
" Low level input isn't 100% reliable
|
||||||
|
let g:test_is_flaky = 1
|
||||||
|
|
||||||
set mousemodel=extend
|
set mousemodel=extend
|
||||||
call test_override('no_query_mouse', 1)
|
call test_override('no_query_mouse', 1)
|
||||||
new
|
new
|
||||||
call setline(1, ['one two three', 'four five six'])
|
call setline(1, ['one two three', 'four five six'])
|
||||||
|
|
||||||
" place the cursor using left click in normal mode
|
|
||||||
call cursor(1, 1)
|
call cursor(1, 1)
|
||||||
|
redraw!
|
||||||
|
|
||||||
|
" place the cursor using left click and release in normal mode
|
||||||
let args = #{button: 0, row: 2, col: 4, multiclick: 0, modifiers: 0}
|
let args = #{button: 0, row: 2, col: 4, multiclick: 0, modifiers: 0}
|
||||||
call test_gui_event('mouse', args)
|
call test_gui_event('mouse', args)
|
||||||
let args.button = 3
|
let args.button = 3
|
||||||
@@ -1175,10 +1179,21 @@ func Test_gui_mouse_event()
|
|||||||
call feedkeys("\<Esc>", 'Lx!')
|
call feedkeys("\<Esc>", 'Lx!')
|
||||||
call assert_equal([0, 2, 7, 0], getpos('.'))
|
call assert_equal([0, 2, 7, 0], getpos('.'))
|
||||||
call assert_equal('wo thrfour five sixteen', getline(2))
|
call assert_equal('wo thrfour five sixteen', getline(2))
|
||||||
|
|
||||||
set mouse&
|
set mouse&
|
||||||
let &guioptions = save_guioptions
|
let &guioptions = save_guioptions
|
||||||
|
bw!
|
||||||
|
call test_override('no_query_mouse', 0)
|
||||||
|
set mousemodel&
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
" Test invalid parameters for test_gui_event()
|
||||||
|
func Test_gui_event_mouse_fails()
|
||||||
|
call test_override('no_query_mouse', 1)
|
||||||
|
new
|
||||||
|
call setline(1, ['one two three', 'four five six'])
|
||||||
|
set mousemodel=extend
|
||||||
|
|
||||||
" Test invalid parameters for test_gui_event()
|
|
||||||
let args = #{row: 2, col: 4, multiclick: 0, modifiers: 0}
|
let args = #{row: 2, col: 4, multiclick: 0, modifiers: 0}
|
||||||
call assert_false(test_gui_event('mouse', args))
|
call assert_false(test_gui_event('mouse', args))
|
||||||
let args = #{button: 0, col: 4, multiclick: 0, modifiers: 0}
|
let args = #{button: 0, col: 4, multiclick: 0, modifiers: 0}
|
||||||
|
@@ -695,6 +695,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
968,
|
||||||
/**/
|
/**/
|
||||||
967,
|
967,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user