]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1937: tests: Test_matchfuzzy_initialized() fails v9.1.1937
authorCorey Hickey <bugfood-c@fatooh.org>
Sun, 30 Nov 2025 15:02:39 +0000 (15:02 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 30 Nov 2025 15:02:39 +0000 (15:02 +0000)
Problem:  tests: Test_matchfuzzy_initialized() fails
Solution: Send a dummy key (Corey Hickey)

Test_matchfuzzy_initialized seems to expect that the 'lvimgrep' will be
interrupted by sending a SIGINT. If the search finishes beforehand,
though, then the SIGINT triggers vim to tell the user how to quit.

Vim does not show this message immediately, though; instead, vim shows
the message next time it is active. When StopVimInTerminal() sends a key
sequence intended to cause vim to quit, this activates vim to show the
message instead of quitting.

I do not understand every detail of the problem fully--if I type the
characters from StopVimInTerminal() into a post-SIGTERM terminal
directly, that seems to work ok; there seems to be a timing issue due to
sending all the characters at once.

This fix does make the test work reliably for me, and the test still
works even if I limit my CPU frequency so that the search is interrupted
by the SIGINT.

fixes: #18821
related: #18822

Signed-off-by: Corey Hickey <bugfood-c@fatooh.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_matchfuzzy.vim
src/version.c

index 0ee1b7ba6740aafe49793a102fd8f2a0299c2a09..3ad0d720ab7125f5dd749f9d600c3942318026d7 100644 (file)
@@ -305,6 +305,13 @@ func Test_matchfuzzy_initialized()
   let job = term_getjob(buf)
   if job_status(job) == "run"
     call job_stop(job, "int")
+    " The search might or might not have been completed. If the search is
+    " finished and Vim receives a SIGINT, then that will trigger a message
+    " next time Vim is active:
+    "   Type  :qa  and press <Enter> to exit Vim
+    " If we do not send something here to trigger displaying the message, before
+    " TermWait(), then the exit sequence sent afterward does not work.
+    call term_sendkeys(buf, "\<C-O>")
     call TermWait(buf, 50)
   endif
 
index 8202641a5c5f6d93c519380054ed4e372230cff3..8f57d8bddbe0c5724bd83668784c317fa6f8e9d0 100644 (file)
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1937,
 /**/
     1936,
 /**/