summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal3.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-20 18:59:06 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-20 18:59:06 +0200
commit733d259a83bfdd3e1670cc1665e1bd56501799df (patch)
treec570802fe9e1ebda08989283fe5c0d677d55d423 /src/testdir/test_terminal3.vim
parent17f67547f36a06220ea4667aaee7bb130108f568 (diff)
downloadvim-git-733d259a83bfdd3e1670cc1665e1bd56501799df.tar.gz
patch 8.2.1498: on slow systems tests can be flakyv8.2.1498
Problem: On slow systems tests can be flaky. Solution: Use TermWait() instead of term-wait(). (Yegappan Lakshmanan, closes #6756)
Diffstat (limited to 'src/testdir/test_terminal3.vim')
-rw-r--r--src/testdir/test_terminal3.vim38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/testdir/test_terminal3.vim b/src/testdir/test_terminal3.vim
index 30ff3e798..e98219016 100644
--- a/src/testdir/test_terminal3.vim
+++ b/src/testdir/test_terminal3.vim
@@ -374,7 +374,7 @@ func Test_term_mouse()
call term_sendkeys(buf, ":set mouse=a term=xterm ttymouse=sgr\<CR>")
call term_sendkeys(buf, ":set clipboard=\<CR>")
call term_sendkeys(buf, ":set mousemodel=extend\<CR>")
- call term_wait(buf)
+ call TermWait(buf)
redraw!
" Use the mouse to enter the terminal window
@@ -388,9 +388,9 @@ func Test_term_mouse()
call feedkeys("\<LeftMouse>\<LeftRelease>", 'xt')
call test_setmouse(3, 8)
call term_sendkeys(buf, "\<LeftMouse>\<LeftRelease>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([json_encode(getpos('.'))], 'Xbuf')\<CR>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
let pos = json_decode(readfile('Xbuf')[0])
call assert_equal([3, 8], pos[1:2])
@@ -400,9 +400,9 @@ func Test_term_mouse()
call term_sendkeys(buf, "\<LeftMouse>")
call test_setmouse(2, 16)
call term_sendkeys(buf, "\<LeftRelease>y")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call assert_equal('yellow', readfile('Xbuf')[0])
" Test for selecting text using doubleclick
@@ -411,18 +411,18 @@ func Test_term_mouse()
call term_sendkeys(buf, "\<LeftMouse>\<LeftRelease>\<LeftMouse>")
call test_setmouse(1, 17)
call term_sendkeys(buf, "\<LeftRelease>y")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call assert_equal('three four', readfile('Xbuf')[0])
" Test for selecting a line using triple click
call delete('Xbuf')
call test_setmouse(3, 2)
call term_sendkeys(buf, "\<LeftMouse>\<LeftRelease>\<LeftMouse>\<LeftRelease>\<LeftMouse>\<LeftRelease>y")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call assert_equal("vim emacs sublime nano\n", readfile('Xbuf')[0])
" Test for selecting a block using qudraple click
@@ -431,9 +431,9 @@ func Test_term_mouse()
call term_sendkeys(buf, "\<LeftMouse>\<LeftRelease>\<LeftMouse>\<LeftRelease>\<LeftMouse>\<LeftRelease>\<LeftMouse>")
call test_setmouse(3, 13)
call term_sendkeys(buf, "\<LeftRelease>y")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call assert_equal("ree\nyel\nsub", readfile('Xbuf')[0])
" Test for extending a selection using right click
@@ -442,9 +442,9 @@ func Test_term_mouse()
call term_sendkeys(buf, "\<LeftMouse>\<LeftRelease>")
call test_setmouse(2, 16)
call term_sendkeys(buf, "\<RightMouse>\<RightRelease>y")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([@\"], 'Xbuf')\<CR>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call assert_equal("n yellow", readfile('Xbuf')[0])
" Test for pasting text using middle click
@@ -452,13 +452,13 @@ func Test_term_mouse()
call term_sendkeys(buf, ":let @r='bright '\<CR>")
call test_setmouse(2, 22)
call term_sendkeys(buf, "\"r\<MiddleMouse>\<MiddleRelease>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call term_sendkeys(buf, ":call writefile([getline(2)], 'Xbuf')\<CR>")
- call term_wait(buf, 50)
+ call TermWait(buf, 50)
call assert_equal("red bright blue", readfile('Xbuf')[0][-15:])
" cleanup
- call term_wait(buf)
+ call TermWait(buf)
call StopVimInTerminal(buf)
let &mouse = save_mouse
let &term = save_term
@@ -494,14 +494,14 @@ func Test_term_modeless_selection()
let buf = RunVimInTerminal('Xtest_modeless -n', {})
call term_sendkeys(buf, ":set nocompatible\<CR>")
call term_sendkeys(buf, ":set mouse=\<CR>")
- call term_wait(buf)
+ call TermWait(buf)
redraw!
" Use the mouse to enter the terminal window
call win_gotoid(prev_win)
call feedkeys(MouseLeftClickCode(1, 1), 'x')
call feedkeys(MouseLeftReleaseCode(1, 1), 'x')
- call term_wait(buf)
+ call TermWait(buf)
call assert_equal(1, getwininfo(win_getid())[0].terminal)
" Test for copying a modeless selection to clipboard
@@ -514,7 +514,7 @@ func Test_term_modeless_selection()
call assert_equal("d green y", @*)
" cleanup
- call term_wait(buf)
+ call TermWait(buf)
call StopVimInTerminal(buf)
let &mouse = save_mouse
let &term = save_term