summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-12 21:38:29 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-12 21:38:29 +0200
commita4b442614c5ca4ebf32acf5cf0b7b718496f1c94 (patch)
tree92498108ca7a9892654ac6c3c0d1cb14892fa934
parentc212dd0a346d57f62013094ea6861eb28e33023c (diff)
downloadvim-git-a4b442614c5ca4ebf32acf5cf0b7b718496f1c94.tar.gz
patch 8.2.1198: terminal2 test sometimes hangs in the GUI on Travisv8.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.
-rw-r--r--src/testdir/test_terminal2.vim44
-rw-r--r--src/testdir/test_terminal3.vim44
-rw-r--r--src/version.c2
3 files changed, 46 insertions, 44 deletions
diff --git a/src/testdir/test_terminal2.vim b/src/testdir/test_terminal2.vim
index b0eb3faf4..deeb86f94 100644
--- a/src/testdir/test_terminal2.vim
+++ b/src/testdir/test_terminal2.vim
@@ -536,49 +536,5 @@ func Test_term_gettty()
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\<CR>")
- call StopVimInTerminal(buf)
- call delete('XTest_getwinpos')
- exe buf . 'bwipe!'
- set splitright&
- only!
-endfunc
-
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim
index add767801..8405cd16a 100644
--- a/src/testdir/test_terminal3.vim
+++ b/src/testdir/test_terminal3.vim
@@ -519,5 +519,49 @@ func Test_term_modeless_selection()
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\<CR>")
+ call StopVimInTerminal(buf)
+ call delete('XTest_getwinpos')
+ exe buf . 'bwipe!'
+ set splitright&
+ only!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index 19b911e46..9d59181c9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1198,
+/**/
1197,
/**/
1196,