# HG changeset patch # User Bram Moolenaar # Date 1668084308 -3600 # Node ID ac16c9a934adeeb213bafbfb3e85ac259637f1f7 # Parent 6b1185f5c86fbf4a48afc029a4c29b5a3f9dbb16 patch 9.0.0853: terminal mouse test is still flaky on MacOS M1 Commit: https://github.com/vim/vim/commit/98aebcc2c6f4b131d2098ebc60c4a552a5163aec Author: Bram Moolenaar Date: Thu Nov 10 12:38:16 2022 +0000 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 --- 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 --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 853, +/**/ 852, /**/ 851,