summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-10 12:38:16 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-10 12:38:16 +0000
commit98aebcc2c6f4b131d2098ebc60c4a552a5163aec (patch)
tree34daf2d0809831b22e394a0d4b09d667351e3884 /src
parent90e66ec1e1f8eb13a833546f18e061a5709604da (diff)
patch 9.0.0853: terminal mouse test is still flaky on MacOS M1v9.0.0853
Problem: Terminal mouse test is still flaky on MacOS M1. Solution: Also wait for the file to have some contents.
Diffstat (limited to 'src')
-rw-r--r--src/testdir/test_terminal3.vim19
-rw-r--r--src/version.c2
2 files changed, 13 insertions, 8 deletions
diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim
index f871187ef3..f23bfd2246 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')\<CR>")
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, "\<LeftRelease>y")
call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- 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, "\<LeftRelease>y")
call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- 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, "\<LeftMouse>\<LeftRelease>\<LeftMouse>\<LeftRelease>\<LeftMouse>\<LeftRelease>y")
call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- 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, "\<LeftRelease>y")
call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- 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, "\<RightMouse>\<RightRelease>y")
call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- 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\<MiddleMouse>\<MiddleRelease>")
call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([getline(2)], 'Xbuf')\<CR>")
- 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 8056d66a5a..3b22d4e77b 100644
--- 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,