]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0605: tests: Test_screenpos() is flaky in GUI v9.2.0605
authorthinca <thinca@gmail.com>
Tue, 9 Jun 2026 18:39:52 +0000 (18:39 +0000)
committerChristian Brabandt <cb@256bit.org>
Tue, 9 Jun 2026 18:39:52 +0000 (18:39 +0000)
Problem:  Test_screenpos() fails intermittently in the GUI testgui CI
          job with "Expected {'row': 22} but got {'row': 23}".  In the
          GUI, the window height reported by getwininfo() before the
          final redraw can be stale, so the cached wininfo.height does
          not match the actual window height when the assertion runs.
Solution: Use winheight(winid) at assertion time so the height reflects
          the window state after the redraw.

closes: #20457

Signed-off-by: thinca <thinca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_cursor_func.vim
src/version.c

index e541da886d326496b5cdd65a6a6a46c4c69b936a..9aaeb5d47dd743abc75d89e2fc5a0e7dda8834b4 100644 (file)
@@ -125,7 +125,7 @@ func Test_screenpos()
   exe "normal G\<C-Y>\<C-Y>"
   redraw
   let winbar_height = get(wininfo, 'winbar', 0)
-  call assert_equal({'row': winrow + wininfo.height - 1 + winbar_height,
+  call assert_equal({'row': winrow + winheight(winid) - 1 + winbar_height,
        \ 'col': wincol + 7,
        \ 'curscol': wincol + 7,
        \ 'endcol': wincol + 7}, winid->screenpos(line('$'), 8))
index b5cae5ec4ec612b8d931a90fa022ea2ad1fac909..68013a0ea5a9a4896790d8707ff86caaa1236974 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    605,
 /**/
     604,
 /**/