To: vim_dev@googlegroups.com Subject: Patch 8.2.1198 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1198 Problem: Terminal2 test sometimes hangs in the GUI on Travis. Solution: Move test function to terminal3 to see if the problem moves too. Files: src/testdir/test_terminal2.vim, src/testdir/test_terminal3.vim *** ../vim-8.2.1197/src/testdir/test_terminal2.vim 2020-07-12 14:09:19.480092872 +0200 --- src/testdir/test_terminal2.vim 2020-07-12 21:36:15.531774821 +0200 *************** *** 536,584 **** exe buf . 'bwipe' endfunc - func Test_terminal_getwinpos() - CheckRunVimInTerminal - - " split, go to the bottom-right window - split - wincmd j - set splitright - - call writefile([ - \ 'echo getwinpos()', - \ ], 'XTest_getwinpos') - let buf = RunVimInTerminal('-S XTest_getwinpos', {'cols': 60}) - call TermWait(buf) - - " Find the output of getwinpos() in the bottom line. - let rows = term_getsize(buf)[0] - call WaitForAssert({-> assert_match('\[\d\+, \d\+\]', term_getline(buf, rows))}) - let line = term_getline(buf, rows) - let xpos = str2nr(substitute(line, '\[\(\d\+\), \d\+\]', '\1', '')) - let ypos = str2nr(substitute(line, '\[\d\+, \(\d\+\)\]', '\1', '')) - - " Position must be bigger than the getwinpos() result of Vim itself. - " The calculation in the console assumes a 10 x 7 character cell. - " In the GUI it can be more, let's assume a 20 x 14 cell. - " And then add 100 / 200 tolerance. - let [xroot, yroot] = getwinpos() - let winpos = 50->getwinpos() - call assert_equal(xroot, winpos[0]) - call assert_equal(yroot, winpos[1]) - let [winrow, wincol] = win_screenpos('.') - let xoff = wincol * (has('gui_running') ? 14 : 7) + 100 - let yoff = winrow * (has('gui_running') ? 20 : 10) + 200 - call assert_inrange(xroot + 2, xroot + xoff, xpos) - call assert_inrange(yroot + 2, yroot + yoff, ypos) - - call TermWait(buf) - call term_sendkeys(buf, ":q\") - call StopVimInTerminal(buf) - call delete('XTest_getwinpos') - exe buf . 'bwipe!' - set splitright& - only! - endfunc - " vim: shiftwidth=2 sts=2 expandtab --- 536,540 ---- *** ../vim-8.2.1197/src/testdir/test_terminal3.vim 2020-07-11 13:09:17.377971831 +0200 --- src/testdir/test_terminal3.vim 2020-07-12 21:36:29.451719037 +0200 *************** *** 519,523 **** --- 519,567 ---- new | only! endfunc + func Test_terminal_getwinpos() + CheckRunVimInTerminal + + " split, go to the bottom-right window + split + wincmd j + set splitright + + call writefile([ + \ 'echo getwinpos()', + \ ], 'XTest_getwinpos') + let buf = RunVimInTerminal('-S XTest_getwinpos', {'cols': 60}) + call TermWait(buf) + + " Find the output of getwinpos() in the bottom line. + let rows = term_getsize(buf)[0] + call WaitForAssert({-> assert_match('\[\d\+, \d\+\]', term_getline(buf, rows))}) + let line = term_getline(buf, rows) + let xpos = str2nr(substitute(line, '\[\(\d\+\), \d\+\]', '\1', '')) + let ypos = str2nr(substitute(line, '\[\d\+, \(\d\+\)\]', '\1', '')) + + " Position must be bigger than the getwinpos() result of Vim itself. + " The calculation in the console assumes a 10 x 7 character cell. + " In the GUI it can be more, let's assume a 20 x 14 cell. + " And then add 100 / 200 tolerance. + let [xroot, yroot] = getwinpos() + let winpos = 50->getwinpos() + call assert_equal(xroot, winpos[0]) + call assert_equal(yroot, winpos[1]) + let [winrow, wincol] = win_screenpos('.') + let xoff = wincol * (has('gui_running') ? 14 : 7) + 100 + let yoff = winrow * (has('gui_running') ? 20 : 10) + 200 + call assert_inrange(xroot + 2, xroot + xoff, xpos) + call assert_inrange(yroot + 2, yroot + yoff, ypos) + + call TermWait(buf) + call term_sendkeys(buf, ":q\") + call StopVimInTerminal(buf) + call delete('XTest_getwinpos') + exe buf . 'bwipe!' + set splitright& + only! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.1197/src/version.c 2020-07-12 20:49:25.488102795 +0200 --- src/version.c 2020-07-12 21:37:54.499340002 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1198, /**/ -- hundred-and-one symptoms of being an internet addict: 21. Your dog has its own home page. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///