To: vim_dev@googlegroups.com Subject: Patch 9.0.0853 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0853 (after 9.0.0851) Problem: Terminal mouse test is still flaky on MacOS M1. Solution: Also wait for the file to have some contents. Files: src/testdir/test_terminal3.vim *** ../vim-9.0.0852/src/testdir/test_terminal3.vim 2022-11-10 00:09:17.892798851 +0000 --- src/testdir/test_terminal3.vim 2022-11-10 12:35:05.788085964 +0000 *************** *** 686,692 **** call TermWait(buf) redraw! ! let XbufExists = {-> filereadable('Xbuf')} " Use the mouse to enter the terminal window call win_gotoid(prev_win) --- 686,695 ---- call TermWait(buf) redraw! ! " 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,709 **** call delete('Xbuf') call term_sendkeys(buf, ":call writefile([json_encode(getpos('.'))], 'Xbuf')\") call TermWait(buf, 50) ! call WaitFor(XbufExists) let pos = json_decode(readfile('Xbuf')[0]) call assert_equal([3, 8], pos[1:2]) call delete('Xbuf') --- 706,712 ---- call delete('Xbuf') call term_sendkeys(buf, ":call writefile([json_encode(getpos('.'))], 'Xbuf')\") call TermWait(buf, 50) ! call WaitFor(XbufNotEmpty) let pos = json_decode(readfile('Xbuf')[0]) call assert_equal([3, 8], pos[1:2]) call delete('Xbuf') *************** *** 715,721 **** call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufExists) call WaitForAssert({-> assert_equal('yellow', readfile('Xbuf')[0])}) call delete('Xbuf') --- 718,724 ---- call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufNotEmpty) call WaitForAssert({-> assert_equal('yellow', readfile('Xbuf')[0])}) call delete('Xbuf') *************** *** 726,732 **** call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufExists) call assert_equal('three four', readfile('Xbuf')[0]) call delete('Xbuf') --- 729,735 ---- call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufNotEmpty) call assert_equal('three four', readfile('Xbuf')[0]) call delete('Xbuf') *************** *** 735,741 **** call term_sendkeys(buf, "\\\\\\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufExists) call assert_equal("vim emacs sublime nano\n", readfile('Xbuf')[0]) call delete('Xbuf') --- 738,744 ---- call term_sendkeys(buf, "\\\\\\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufNotEmpty) call assert_equal("vim emacs sublime nano\n", readfile('Xbuf')[0]) call delete('Xbuf') *************** *** 746,752 **** call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufExists) call assert_equal("ree\nyel\nsub", readfile('Xbuf')[0]) call delete('Xbuf') --- 749,755 ---- call term_sendkeys(buf, "\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufNotEmpty) call assert_equal("ree\nyel\nsub", readfile('Xbuf')[0]) call delete('Xbuf') *************** *** 757,763 **** call term_sendkeys(buf, "\\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufExists) call assert_equal("n yellow", readfile('Xbuf')[0]) call delete('Xbuf') --- 760,766 ---- call term_sendkeys(buf, "\\y") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\") ! call WaitFor(XbufNotEmpty) call assert_equal("n yellow", readfile('Xbuf')[0]) call delete('Xbuf') *************** *** 767,773 **** call term_sendkeys(buf, "\"r\\") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([getline(2)], 'Xbuf')\") ! call WaitFor(XbufExists) call assert_equal("red bright blue", readfile('Xbuf')[0][-15:]) call delete('Xbuf') --- 770,776 ---- call term_sendkeys(buf, "\"r\\") call TermWait(buf, 50) call term_sendkeys(buf, ":call writefile([getline(2)], 'Xbuf')\") ! call WaitFor(XbufNotEmpty) call assert_equal("red bright blue", readfile('Xbuf')[0][-15:]) call delete('Xbuf') *** ../vim-9.0.0852/src/version.c 2022-11-10 00:25:00.577023938 +0000 --- src/version.c 2022-11-10 12:37:51.220125363 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 853, /**/ -- A day without sunshine is like, well, night. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///