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')\<CR>")
    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')\<CR>")
    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, "\<LeftRelease>y")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
!   call WaitFor(XbufExists)
    call WaitForAssert({-> assert_equal('yellow', readfile('Xbuf')[0])})
    call delete('Xbuf')
  
--- 718,724 ----
    call term_sendkeys(buf, "\<LeftRelease>y")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
!   call WaitFor(XbufNotEmpty)
    call WaitForAssert({-> assert_equal('yellow', readfile('Xbuf')[0])})
    call delete('Xbuf')
  
***************
*** 726,732 ****
    call term_sendkeys(buf, "\<LeftRelease>y")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
!   call WaitFor(XbufExists)
    call assert_equal('three four', readfile('Xbuf')[0])
    call delete('Xbuf')
  
--- 729,735 ----
    call term_sendkeys(buf, "\<LeftRelease>y")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
!   call WaitFor(XbufNotEmpty)
    call assert_equal('three four', readfile('Xbuf')[0])
    call delete('Xbuf')
  
***************
*** 735,741 ****
    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 assert_equal("vim emacs sublime nano\n", readfile('Xbuf')[0])
    call delete('Xbuf')
  
--- 738,744 ----
    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(XbufNotEmpty)
    call assert_equal("vim emacs sublime nano\n", readfile('Xbuf')[0])
    call delete('Xbuf')
  
***************
*** 746,752 ****
    call term_sendkeys(buf, "\<LeftRelease>y")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
!   call WaitFor(XbufExists)
    call assert_equal("ree\nyel\nsub", readfile('Xbuf')[0])
    call delete('Xbuf')
  
--- 749,755 ----
    call term_sendkeys(buf, "\<LeftRelease>y")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
!   call WaitFor(XbufNotEmpty)
    call assert_equal("ree\nyel\nsub", readfile('Xbuf')[0])
    call delete('Xbuf')
  
***************
*** 757,763 ****
    call term_sendkeys(buf, "\<RightMouse>\<RightRelease>y")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
!   call WaitFor(XbufExists)
    call assert_equal("n yellow", readfile('Xbuf')[0])
    call delete('Xbuf')
  
--- 760,766 ----
    call term_sendkeys(buf, "\<RightMouse>\<RightRelease>y")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
!   call WaitFor(XbufNotEmpty)
    call assert_equal("n yellow", readfile('Xbuf')[0])
    call delete('Xbuf')
  
***************
*** 767,773 ****
    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 assert_equal("red bright blue", readfile('Xbuf')[0][-15:])
    call delete('Xbuf')
  
--- 770,776 ----
    call term_sendkeys(buf, "\"r\<MiddleMouse>\<MiddleRelease>")
    call TermWait(buf, 50)
    call term_sendkeys(buf, ":call writefile([getline(2)], 'Xbuf')\<CR>")
!   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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20221110123842.EE3E61C108B%40moolenaar.net.

Raspunde prin e-mail lui