1
0
forked from aniani/vim

patch 8.1.1266: winbar test doesn't test enough

Problem:    Winbar test doesn't test enough.
Solution:   Check that the WinBar actually shows up.  Correct check for clicks
            with no effect. (Ben Jackson, closes #4338)
This commit is contained in:
Bram Moolenaar
2019-05-04 17:30:04 +02:00
parent bedf091a95
commit 8caef443b2
2 changed files with 9 additions and 1 deletions

View File

@@ -4,10 +4,15 @@ if !has('menu')
finish finish
endif endif
source shared.vim
func Test_add_remove_menu() func Test_add_remove_menu()
new new
amenu 1.10 WinBar.Next :let g:did_next = 11<CR> amenu 1.10 WinBar.Next :let g:did_next = 11<CR>
amenu 1.20 WinBar.Cont :let g:did_cont = 12<CR> amenu 1.20 WinBar.Cont :let g:did_cont = 12<CR>
redraw
call assert_match('Next Cont', Screenline(1))
emenu WinBar.Next emenu WinBar.Next
call assert_equal(11, g:did_next) call assert_equal(11, g:did_next)
emenu WinBar.Cont emenu WinBar.Cont
@@ -28,6 +33,7 @@ func Test_click_in_winbar()
amenu 1.20 WinBar.Cont :let g:did_cont = 12<CR> amenu 1.20 WinBar.Cont :let g:did_cont = 12<CR>
amenu 1.30 WinBar.Close :close<CR> amenu 1.30 WinBar.Close :close<CR>
redraw redraw
call assert_match('Next Cont Close', Screenline(1))
let save_mouse = &mouse let save_mouse = &mouse
set mouse=a set mouse=a
@@ -38,7 +44,7 @@ func Test_click_in_winbar()
let g:did_next = 0 let g:did_next = 0
let g:did_cont = 0 let g:did_cont = 0
for col in [1, 8, 9, 16, 17, 25, 26] for col in [1, 8, 9, 16, 17, 25, 26]
call test_setmouse(1, 1) call test_setmouse(1, col)
call feedkeys("\<LeftMouse>", "xt") call feedkeys("\<LeftMouse>", "xt")
call assert_equal(0, g:did_next, 'col ' .. col) call assert_equal(0, g:did_next, 'col ' .. col)
call assert_equal(0, g:did_cont, 'col ' .. col) call assert_equal(0, g:did_cont, 'col ' .. col)

View File

@@ -767,6 +767,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 */
/**/
1266,
/**/ /**/
1265, 1265,
/**/ /**/