Skip to content

Commit 13c724f

Browse files
committed
patch 8.0.0310: not enough testing for GUI functionality
Problem: Not enough testing for GUI functionality. Solution: Add tests for v:windowid and getwinpos[xy](). (Kazunobu Kuriyama)
1 parent 059b748 commit 13c724f

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/testdir/test_gui.vim

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ if !has('gui') || ($DISPLAY == "" && !has('gui_running'))
44
finish
55
endif
66

7+
let s:x11_based_gui = has('gui_athena') || has('gui_motif')
8+
\ || has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
9+
710
" For KDE set a font, empty 'guifont' may cause a hang.
811
func SetUp()
912
if has("gui_kde")
@@ -32,10 +35,23 @@ func Test_1_set_secure()
3235
call assert_equal(1, has('gui_running'))
3336
endfunc
3437

38+
func Test_getwinpos()
39+
call assert_match('Window position: X \d\+, Y \d\+', execute('winpos'))
40+
call assert_true(getwinposx() >= 0)
41+
call assert_true(getwinposy() >= 0)
42+
endfunction
43+
3544
func Test_shell_command()
3645
new
3746
r !echo hello
3847
call assert_equal('hello', substitute(getline(2), '\W', '', 'g'))
3948
bwipe!
40-
call assert_true(1, match(execute('winpos'), 'Window position: X \d\+, Y \d\+') >= 0)
4149
endfunc
50+
51+
func Test_windowid_variable()
52+
if s:x11_based_gui || has('win32')
53+
call assert_true(v:windowid > 0)
54+
else
55+
call assert_equal(0, v:windowid)
56+
endif
57+
endfunction

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
310,
767769
/**/
768770
309,
769771
/**/

0 commit comments

Comments
 (0)