From: Bram Moolenaar Date: Thu, 10 Nov 2022 12:38:16 +0000 (+0000) Subject: patch 9.0.0853: terminal mouse test is still flaky on MacOS M1 X-Git-Tag: v9.0.0853 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98aebcc2c6f4b131d2098ebc60c4a552a5163aec;p=vim patch 9.0.0853: terminal mouse test is still flaky on MacOS M1 Problem: Terminal mouse test is still flaky on MacOS M1. Solution: Also wait for the file to have some contents. --- diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim index f871187ef..f23bfd224 100644 --- a/src/testdir/test_terminal3.vim +++ b/src/testdir/test_terminal3.vim @@ -686,7 +686,10 @@ func Test_term_mouse() call TermWait(buf) redraw! - let XbufExists = {-> filereadable('Xbuf')} + " Funcref used in WaitFor() to check that the "Xbuf" file is readable and + " has some contents. This avoids a "List index out of range" error when the + " file hasn't been written yet. + let XbufNotEmpty = {-> filereadable('Xbuf') && len(readfile('Xbuf')) > 0} " Use the mouse to enter the terminal window call win_gotoid(prev_win) @@ -703,7 +706,7 @@ func Test_term_mouse() call delete('Xbuf') call term_sendkeys(buf, ":call writefile([json_encode(getpos('.'))], 'Xbuf')\") call TermWait(buf, 50) - call WaitFor(XbufExists) + call WaitFor(XbufNotEmpty) let pos = json_decode(readfile('Xbuf')[0]) call assert_equal([3, 8], pos[1:2]) call delete('Xbuf') @@ -715,7 +718,7 @@ func Test_term_mouse() call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") - call WaitFor(XbufExists) + call WaitFor(XbufNotEmpty) call WaitForAssert({-> assert_equal('yellow', readfile('Xbuf')[0])}) call delete('Xbuf') @@ -726,7 +729,7 @@ func Test_term_mouse() call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") - call WaitFor(XbufExists) + call WaitFor(XbufNotEmpty) call assert_equal('three four', readfile('Xbuf')[0]) call delete('Xbuf') @@ -735,7 +738,7 @@ func Test_term_mouse() call term_sendkeys(buf, "\\\\\\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") - call WaitFor(XbufExists) + call WaitFor(XbufNotEmpty) call assert_equal("vim emacs sublime nano\n", readfile('Xbuf')[0]) call delete('Xbuf') @@ -746,7 +749,7 @@ func Test_term_mouse() call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") - call WaitFor(XbufExists) + call WaitFor(XbufNotEmpty) call assert_equal("ree\nyel\nsub", readfile('Xbuf')[0]) call delete('Xbuf') @@ -757,7 +760,7 @@ func Test_term_mouse() call term_sendkeys(buf, "\\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") - call WaitFor(XbufExists) + call WaitFor(XbufNotEmpty) call assert_equal("n yellow", readfile('Xbuf')[0]) call delete('Xbuf') @@ -767,7 +770,7 @@ func Test_term_mouse() call term_sendkeys(buf, "\"r\\") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([getline(2)], 'Xbuf')\") - call WaitFor(XbufExists) + call WaitFor(XbufNotEmpty) call assert_equal("red bright blue", readfile('Xbuf')[0][-15:]) call delete('Xbuf') diff --git a/src/version.c b/src/version.c index 8056d66a5..3b22d4e77 100644 --- a/src/version.c +++ b/src/version.c @@ -695,6 +695,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 853, /**/ 852, /**/