From 57bd41da4d2fd82ef4886c663dd8188e6edf59fc Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 3 May 2026 07:05:55 +0800 Subject: [PATCH] vim-patch:9.2.0429: tests: flaky screendump Test_smoothscroll_incsearch() Problem: tests: flaky screendump Test_smoothscroll_incsearch() Solution: Replace screendump test by WaitForAssert() (Yasuhiro Matsumoto) VerifyScreenDump fails consistently on the macos-15-intel CI runner. Replace the dump comparisons with assertions that verify the actual invariant under test: that the visible buffer view stays unchanged across the four incremental-search keystrokes (i.e. skipcol is not reset). Drop the now-unused dump files. closes: vim/vim#20118 https://github.com/vim/vim/commit/e25933014c1c7cc4fb40a6ed429b80fdb37ba28e Co-authored-by: Yasuhiro Matsumoto --- test/old/testdir/test_scroll_opt.vim | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim index 6f2f8010f4..909bd3833c 100644 --- a/test/old/testdir/test_scroll_opt.vim +++ b/test/old/testdir/test_scroll_opt.vim @@ -907,7 +907,7 @@ endfunc " skipcol should not reset when doing incremental search on the same word func Test_smoothscroll_incsearch() - CheckScreendump + CheckRunVimInTerminal let lines =<< trim END set smoothscroll number scrolloff=0 incsearch @@ -917,15 +917,24 @@ func Test_smoothscroll_incsearch() END call writefile(lines, 'XSmoothIncsearch', 'D') let buf = RunVimInTerminal('-S XSmoothIncsearch', #{rows: 8, cols: 40}) + let g:test_is_flaky = 1 call term_sendkeys(buf, "/b") - call VerifyScreenDump(buf, 'Test_smooth_incsearch_1', {}) + call WaitForAssert({-> assert_match('^/b\s*$', term_getline(buf, 8))}, 1000) + let view1 = map(range(1, 7), {_, i -> term_getline(buf, i)}) + call term_sendkeys(buf, "b") - call VerifyScreenDump(buf, 'Test_smooth_incsearch_2', {}) + call WaitForAssert({-> assert_match('^/bb\s*$', term_getline(buf, 8))}, 1000) + call assert_equal(view1, map(range(1, 7), {_, i -> term_getline(buf, i)})) + call term_sendkeys(buf, "b") - call VerifyScreenDump(buf, 'Test_smooth_incsearch_3', {}) + call WaitForAssert({-> assert_match('^/bbb\s*$', term_getline(buf, 8))}, 1000) + call assert_equal(view1, map(range(1, 7), {_, i -> term_getline(buf, i)})) + call term_sendkeys(buf, "b") - call VerifyScreenDump(buf, 'Test_smooth_incsearch_4', {}) + call WaitForAssert({-> assert_match('^/bbbb\s*$', term_getline(buf, 8))}, 1000) + call assert_equal(view1, map(range(1, 7), {_, i -> term_getline(buf, i)})) + call term_sendkeys(buf, "\") call StopVimInTerminal(buf)