Mirror of the Vim source from https://github.com/vim/vim
修訂 | c087099e91635025293d85b6e1f04ce569f65951 (tree) |
---|---|
時間 | 2020-04-09 05:00:05 |
作者 | Bram Moolenaar <Bram@vim....> |
Commiter | Bram Moolenaar |
patch 8.2.0533: tests using term_wait() can still be flaky
Commit: https://github.com/vim/vim/commit/6a2c5a7dd5c9215cc030d5ea6e4616d782c091dd
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 8 21:50:25 2020 +0200
@@ -24,6 +24,21 @@ | ||
24 | 24 | call WaitFor({-> job_status(job) == "dead"}) |
25 | 25 | endfunc |
26 | 26 | |
27 | +" Wrapper around term_wait() to allow more time for re-runs of flaky tests | |
28 | +" The second argument is the minimum time to wait in msec, 10 if omitted. | |
29 | +func TermWait(buf, ...) | |
30 | + let wait_time = a:0 ? a:1 : 10 | |
31 | + if g:run_nr == 2 | |
32 | + let wait_time *= 4 | |
33 | + elseif g:run_nr > 2 | |
34 | + let wait_time *= 10 | |
35 | + endif | |
36 | + call term_wait(a:buf, wait_time) | |
37 | + | |
38 | + " In case it wasn't set yet. | |
39 | + let g:test_is_flaky = 1 | |
40 | +endfunc | |
41 | + | |
27 | 42 | " Run Vim with "arguments" in a new terminal window. |
28 | 43 | " By default uses a size of 20 lines and 75 columns. |
29 | 44 | " Returns the buffer number of the terminal. |
@@ -82,7 +97,7 @@ | ||
82 | 97 | let cols = term_getsize(buf)[1] |
83 | 98 | endif |
84 | 99 | |
85 | - call term_wait(buf) | |
100 | + call TermWait(buf) | |
86 | 101 | |
87 | 102 | " Wait for "All" or "Top" of the ruler to be shown in the last line or in |
88 | 103 | " the status line of the last window. This can be quite slow (e.g. when |
@@ -518,7 +518,7 @@ | ||
518 | 518 | call term_sendkeys(buf, ":set nomore\n") |
519 | 519 | call term_sendkeys(buf, ":args a b c\n") |
520 | 520 | call term_sendkeys(buf, ":quit\n") |
521 | - call term_wait(buf) | |
521 | + call TermWait(buf) | |
522 | 522 | call WaitForAssert({-> assert_match('^E173:', term_getline(buf, 6))}) |
523 | 523 | call StopVimInTerminal(buf) |
524 | 524 |
@@ -527,16 +527,16 @@ | ||
527 | 527 | call term_sendkeys(buf, ":set nomore\n") |
528 | 528 | call term_sendkeys(buf, ":args a b c\n") |
529 | 529 | call term_sendkeys(buf, ":confirm quit\n") |
530 | - call term_wait(buf) | |
530 | + call TermWait(buf) | |
531 | 531 | call WaitForAssert({-> assert_match('^\[Y\]es, (N)o: *$', |
532 | 532 | \ term_getline(buf, 6))}) |
533 | 533 | call term_sendkeys(buf, "N") |
534 | - call term_wait(buf) | |
534 | + call TermWait(buf) | |
535 | 535 | call term_sendkeys(buf, ":confirm quit\n") |
536 | 536 | call WaitForAssert({-> assert_match('^\[Y\]es, (N)o: *$', |
537 | 537 | \ term_getline(buf, 6))}) |
538 | 538 | call term_sendkeys(buf, "Y") |
539 | - call term_wait(buf) | |
539 | + call TermWait(buf) | |
540 | 540 | call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))}) |
541 | 541 | only! |
542 | 542 | " When this test fails, swap files are left behind which breaks subsequent |
@@ -1761,9 +1761,9 @@ | ||
1761 | 1761 | augroup END |
1762 | 1762 | let s:li = [] |
1763 | 1763 | let s:dir_this = getcwd() |
1764 | - let s:dir_foo = s:dir_this . '/foo' | |
1764 | + let s:dir_foo = s:dir_this . '/Xfoo' | |
1765 | 1765 | call mkdir(s:dir_foo) |
1766 | - let s:dir_bar = s:dir_this . '/bar' | |
1766 | + let s:dir_bar = s:dir_this . '/Xbar' | |
1767 | 1767 | call mkdir(s:dir_bar) |
1768 | 1768 | endfunc |
1769 | 1769 |
@@ -2291,9 +2291,9 @@ | ||
2291 | 2291 | call WaitForAssert({-> assert_match('^xxx', term_getline(buf, 6))}, 1000) |
2292 | 2292 | |
2293 | 2293 | call term_sendkeys(buf, ":let g:again = ''\<CR>:call CallTimer()\<CR>") |
2294 | - call term_wait(buf, 100) | |
2294 | + call TermWait(buf, 50) | |
2295 | 2295 | call term_sendkeys(buf, ":\<CR>") |
2296 | - call term_wait(buf, 100) | |
2296 | + call TermWait(buf, 50) | |
2297 | 2297 | call term_sendkeys(buf, ":echo g:again\<CR>") |
2298 | 2298 | call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000) |
2299 | 2299 |
@@ -2317,7 +2317,7 @@ | ||
2317 | 2317 | let buf = RunVimInTerminal('-S '.filename, #{rows: 6}) |
2318 | 2318 | |
2319 | 2319 | call term_sendkeys(buf, "q:") |
2320 | - call term_wait(buf) | |
2320 | + call TermWait(buf) | |
2321 | 2321 | call term_sendkeys(buf, ":echo b:dummy_var\<cr>") |
2322 | 2322 | call WaitForAssert({-> assert_match('^This is a dummy', term_getline(buf, 6))}, 2000) |
2323 | 2323 | call term_sendkeys(buf, ":echo &buftype\<cr>") |
@@ -32,14 +32,14 @@ | ||
32 | 32 | |
33 | 33 | " Check that the balloon shows up after a mouse move |
34 | 34 | let buf = RunVimInTerminal('-S XTest_beval', {'rows': 10, 'cols': 50}) |
35 | - call term_wait(buf, 100) | |
35 | + call TermWait(buf, 50) | |
36 | 36 | call term_sendkeys(buf, 'll') |
37 | 37 | call term_sendkeys(buf, ":call Trigger()\<CR>") |
38 | 38 | call VerifyScreenDump(buf, 'Test_balloon_eval_term_01', {}) |
39 | 39 | |
40 | 40 | " Make sure the balloon still shows after 'updatetime' passed and CursorHold |
41 | 41 | " was triggered. |
42 | - call term_wait(buf, 300) | |
42 | + call TermWait(buf, 150) | |
43 | 43 | call VerifyScreenDump(buf, 'Test_balloon_eval_term_01a', {}) |
44 | 44 | |
45 | 45 | " clean up |
@@ -57,7 +57,7 @@ | ||
57 | 57 | |
58 | 58 | " Check that the balloon shows up after a mouse move |
59 | 59 | let buf = RunVimInTerminal('-S XTest_beval_visual', {'rows': 10, 'cols': 50}) |
60 | - call term_wait(buf, 100) | |
60 | + call TermWait(buf, 50) | |
61 | 61 | call VerifyScreenDump(buf, 'Test_balloon_eval_term_02', {}) |
62 | 62 | |
63 | 63 | " clean up |
@@ -164,7 +164,7 @@ | ||
164 | 164 | END |
165 | 165 | call writefile(lines, 'XscriptMatchCommon') |
166 | 166 | let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10}) |
167 | - call term_wait(buf) | |
167 | + call TermWait(buf) | |
168 | 168 | call VerifyScreenDump(buf, 'Test_appendbufline_1', {}) |
169 | 169 | |
170 | 170 | call StopVimInTerminal(buf) |
@@ -1062,7 +1062,7 @@ | ||
1062 | 1062 | END |
1063 | 1063 | call writefile(lines, 'XtestBufferScroll') |
1064 | 1064 | let buf = RunVimInTerminal('-S XtestBufferScroll', #{rows: 10}) |
1065 | - call term_wait(buf, 100) | |
1065 | + call TermWait(buf, 50) | |
1066 | 1066 | call VerifyScreenDump(buf, 'Test_job_buffer_scroll_1', {}) |
1067 | 1067 | |
1068 | 1068 | " clean up |
@@ -947,7 +947,7 @@ | ||
947 | 947 | call writefile(lines, 'XTest_verbose') |
948 | 948 | |
949 | 949 | let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12}) |
950 | - call term_wait(buf, 100) | |
950 | + call TermWait(buf, 50) | |
951 | 951 | call term_sendkeys(buf, ":DoSomething\<CR>") |
952 | 952 | call VerifyScreenDump(buf, 'Test_verbose_option_1', {}) |
953 | 953 |
@@ -1024,7 +1024,7 @@ | ||
1024 | 1024 | call writefile(lines, 'XTest_restore') |
1025 | 1025 | |
1026 | 1026 | let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12}) |
1027 | - call term_wait(buf, 100) | |
1027 | + call TermWait(buf, 50) | |
1028 | 1028 | call term_sendkeys(buf, "q:") |
1029 | 1029 | call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {}) |
1030 | 1030 |
@@ -1146,7 +1146,7 @@ | ||
1146 | 1146 | |
1147 | 1147 | call writefile(lines, 'XtestCmdlineClearTabenter') |
1148 | 1148 | let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10}) |
1149 | - call term_wait(buf, 50) | |
1149 | + call TermWait(buf, 25) | |
1150 | 1150 | " in one tab make the command line higher with CTRL-W - |
1151 | 1151 | call term_sendkeys(buf, ":tabnew\<cr>\<C-w>-\<C-w>-gtgt") |
1152 | 1152 | call VerifyScreenDump(buf, 'Test_cmdlineclear_tabenter', {}) |
@@ -147,7 +147,7 @@ | ||
147 | 147 | call VerifyScreenDump(buf, 'Test_conceal_resize_01', {}) |
148 | 148 | |
149 | 149 | call win_execute(buf->win_findbuf()[0], 'wincmd +') |
150 | - call term_wait(buf) | |
150 | + call TermWait(buf) | |
151 | 151 | call VerifyScreenDump(buf, 'Test_conceal_resize_02', {}) |
152 | 152 | |
153 | 153 | " clean up |
@@ -135,41 +135,41 @@ | ||
135 | 135 | call writefile(lines, filename) |
136 | 136 | " basic test |
137 | 137 | let buf = RunVimInTerminal('-S '. filename, #{rows: 20}) |
138 | - call term_wait(buf) | |
138 | + call TermWait(buf) | |
139 | 139 | call VerifyScreenDump(buf, 'Test_'. filename. '_1', {}) |
140 | 140 | call term_sendkeys(buf, "fagj") |
141 | - call term_wait(buf) | |
141 | + call TermWait(buf) | |
142 | 142 | call VerifyScreenDump(buf, 'Test_'. filename. '_2', {}) |
143 | 143 | call term_sendkeys(buf, "gj") |
144 | - call term_wait(buf) | |
144 | + call TermWait(buf) | |
145 | 145 | call VerifyScreenDump(buf, 'Test_'. filename. '_3', {}) |
146 | 146 | call term_sendkeys(buf, "gj") |
147 | - call term_wait(buf) | |
147 | + call TermWait(buf) | |
148 | 148 | call VerifyScreenDump(buf, 'Test_'. filename. '_4', {}) |
149 | 149 | call term_sendkeys(buf, "gj") |
150 | - call term_wait(buf) | |
150 | + call TermWait(buf) | |
151 | 151 | call VerifyScreenDump(buf, 'Test_'. filename. '_5', {}) |
152 | 152 | call term_sendkeys(buf, "gj") |
153 | - call term_wait(buf) | |
153 | + call TermWait(buf) | |
154 | 154 | call VerifyScreenDump(buf, 'Test_'. filename. '_6', {}) |
155 | 155 | " test with set list and cursorlineopt containing number |
156 | 156 | call term_sendkeys(buf, "gg0") |
157 | 157 | call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\<cr>") |
158 | 158 | call VerifyScreenDump(buf, 'Test_'. filename. '_7', {}) |
159 | 159 | call term_sendkeys(buf, "fagj") |
160 | - call term_wait(buf) | |
160 | + call TermWait(buf) | |
161 | 161 | call VerifyScreenDump(buf, 'Test_'. filename. '_8', {}) |
162 | 162 | call term_sendkeys(buf, "gj") |
163 | - call term_wait(buf) | |
163 | + call TermWait(buf) | |
164 | 164 | call VerifyScreenDump(buf, 'Test_'. filename. '_9', {}) |
165 | 165 | call term_sendkeys(buf, "gj") |
166 | - call term_wait(buf) | |
166 | + call TermWait(buf) | |
167 | 167 | call VerifyScreenDump(buf, 'Test_'. filename. '_10', {}) |
168 | 168 | call term_sendkeys(buf, "gj") |
169 | - call term_wait(buf) | |
169 | + call TermWait(buf) | |
170 | 170 | call VerifyScreenDump(buf, 'Test_'. filename. '_11', {}) |
171 | 171 | call term_sendkeys(buf, "gj") |
172 | - call term_wait(buf) | |
172 | + call TermWait(buf) | |
173 | 173 | call VerifyScreenDump(buf, 'Test_'. filename. '_12', {}) |
174 | 174 | if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent") |
175 | 175 | " test with set foldcolumn signcoloumn and breakindent |
@@ -177,19 +177,19 @@ | ||
177 | 177 | call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\<cr>") |
178 | 178 | call VerifyScreenDump(buf, 'Test_'. filename. '_13', {}) |
179 | 179 | call term_sendkeys(buf, "fagj") |
180 | - call term_wait(buf) | |
180 | + call TermWait(buf) | |
181 | 181 | call VerifyScreenDump(buf, 'Test_'. filename. '_14', {}) |
182 | 182 | call term_sendkeys(buf, "gj") |
183 | - call term_wait(buf) | |
183 | + call TermWait(buf) | |
184 | 184 | call VerifyScreenDump(buf, 'Test_'. filename. '_15', {}) |
185 | 185 | call term_sendkeys(buf, "gj") |
186 | - call term_wait(buf) | |
186 | + call TermWait(buf) | |
187 | 187 | call VerifyScreenDump(buf, 'Test_'. filename. '_16', {}) |
188 | 188 | call term_sendkeys(buf, "gj") |
189 | - call term_wait(buf) | |
189 | + call TermWait(buf) | |
190 | 190 | call VerifyScreenDump(buf, 'Test_'. filename. '_17', {}) |
191 | 191 | call term_sendkeys(buf, "gj") |
192 | - call term_wait(buf) | |
192 | + call TermWait(buf) | |
193 | 193 | call VerifyScreenDump(buf, 'Test_'. filename. '_18', {}) |
194 | 194 | endif |
195 | 195 |
@@ -8,7 +8,7 @@ | ||
8 | 8 | " If the expected output argument is supplied, then check for it. |
9 | 9 | func RunDbgCmd(buf, cmd, ...) |
10 | 10 | call term_sendkeys(a:buf, a:cmd . "\r") |
11 | - call term_wait(a:buf, 20) | |
11 | + call TermWait(a:buf) | |
12 | 12 | |
13 | 13 | if a:0 != 0 |
14 | 14 | " Verify the expected output |
@@ -801,7 +801,7 @@ | ||
801 | 801 | call term_sendkeys(a:buf, ":diffupdate!\<CR>") |
802 | 802 | " trailing : for leaving the cursor on the command line |
803 | 803 | call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\<CR>:") |
804 | - call term_wait(a:buf) | |
804 | + call TermWait(a:buf) | |
805 | 805 | call VerifyScreenDump(a:buf, a:dumpfile, {}) |
806 | 806 | endfunc |
807 | 807 |
@@ -174,7 +174,7 @@ | ||
174 | 174 | call writefile(lines, filename) |
175 | 175 | let buf = RunVimInTerminal('-S '.filename, #{rows: 5, cols: 50}) |
176 | 176 | call term_sendkeys(buf, "k") |
177 | - call term_wait(buf) | |
177 | + call TermWait(buf) | |
178 | 178 | call VerifyScreenDump(buf, 'Test_winline_rnu', {}) |
179 | 179 | |
180 | 180 | " clean up |
@@ -1858,15 +1858,6 @@ | ||
1858 | 1858 | func Test_state() |
1859 | 1859 | CheckRunVimInTerminal |
1860 | 1860 | |
1861 | - " In the first run try a short wait time. If the test fails retry with a | |
1862 | - " longer wait time. | |
1863 | - if g:run_nr == 1 | |
1864 | - let wait_time = 50 | |
1865 | - elseif g:run_nr == 2 | |
1866 | - let wait_time = 200 | |
1867 | - else | |
1868 | - let wait_time = 500 | |
1869 | - endif | |
1870 | 1861 | let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\<CR>" |
1871 | 1862 | |
1872 | 1863 | let lines =<< trim END |
@@ -1888,27 +1879,27 @@ | ||
1888 | 1879 | |
1889 | 1880 | " Using a timer callback |
1890 | 1881 | call term_sendkeys(buf, ":call RunTimer()\<CR>") |
1891 | - call term_wait(buf, wait_time) | |
1882 | + call TermWait(buf, 25) | |
1892 | 1883 | call term_sendkeys(buf, getstate) |
1893 | 1884 | call WaitForAssert({-> assert_match('state: c; mode: n', term_getline(buf, 6))}, 1000) |
1894 | 1885 | |
1895 | 1886 | " Halfway a mapping |
1896 | 1887 | call term_sendkeys(buf, ":call RunTimer()\<CR>;") |
1897 | - call term_wait(buf, wait_time) | |
1888 | + call TermWait(buf, 25) | |
1898 | 1889 | call term_sendkeys(buf, ";") |
1899 | 1890 | call term_sendkeys(buf, getstate) |
1900 | 1891 | call WaitForAssert({-> assert_match('state: mSc; mode: n', term_getline(buf, 6))}, 1000) |
1901 | 1892 | |
1902 | 1893 | " Insert mode completion (bit slower on Mac) |
1903 | 1894 | call term_sendkeys(buf, ":call RunTimer()\<CR>Got\<C-N>") |
1904 | - call term_wait(buf, wait_time) | |
1895 | + call TermWait(buf, 25) | |
1905 | 1896 | call term_sendkeys(buf, "\<Esc>") |
1906 | 1897 | call term_sendkeys(buf, getstate) |
1907 | 1898 | call WaitForAssert({-> assert_match('state: aSc; mode: i', term_getline(buf, 6))}, 1000) |
1908 | 1899 | |
1909 | 1900 | " Autocommand executing |
1910 | 1901 | call term_sendkeys(buf, ":set filetype=foobar\<CR>") |
1911 | - call term_wait(buf, wait_time) | |
1902 | + call TermWait(buf, 25) | |
1912 | 1903 | call term_sendkeys(buf, getstate) |
1913 | 1904 | call WaitForAssert({-> assert_match('state: xS; mode: n', term_getline(buf, 6))}, 1000) |
1914 | 1905 |
@@ -1916,7 +1907,7 @@ | ||
1916 | 1907 | |
1917 | 1908 | " messages scrolled |
1918 | 1909 | call term_sendkeys(buf, ":call RunTimer()\<CR>:echo \"one\\ntwo\\nthree\"\<CR>") |
1919 | - call term_wait(buf, wait_time) | |
1910 | + call TermWait(buf, 25) | |
1920 | 1911 | call term_sendkeys(buf, "\<CR>") |
1921 | 1912 | call term_sendkeys(buf, getstate) |
1922 | 1913 | call WaitForAssert({-> assert_match('state: Scs; mode: r', term_getline(buf, 6))}, 1000) |
@@ -542,9 +542,9 @@ | ||
542 | 542 | \ 'call setline(1, ["","1","2","3",""])', |
543 | 543 | \ ], 'Xtest_cursorline_yank') |
544 | 544 | let buf = RunVimInTerminal('-S Xtest_cursorline_yank', {'rows': 8}) |
545 | - call term_wait(buf) | |
545 | + call TermWait(buf) | |
546 | 546 | call term_sendkeys(buf, "Gy3k") |
547 | - call term_wait(buf) | |
547 | + call TermWait(buf) | |
548 | 548 | call term_sendkeys(buf, "jj") |
549 | 549 | |
550 | 550 | call VerifyScreenDump(buf, 'Test_cursorline_yank_01', {}) |
@@ -582,7 +582,7 @@ | ||
582 | 582 | \ 'call setline(1, repeat(["abc"], 50))', |
583 | 583 | \ ], 'Xtest_cursorline_with_visualmode') |
584 | 584 | let buf = RunVimInTerminal('-S Xtest_cursorline_with_visualmode', {'rows': 12}) |
585 | - call term_wait(buf) | |
585 | + call TermWait(buf) | |
586 | 586 | call term_sendkeys(buf, "V\<C-f>kkkjk") |
587 | 587 | |
588 | 588 | call VerifyScreenDump(buf, 'Test_cursorline_with_visualmode_01', {}) |
@@ -610,9 +610,9 @@ | ||
610 | 610 | END |
611 | 611 | call writefile(lines, 'Xtest_wincolor') |
612 | 612 | let buf = RunVimInTerminal('-S Xtest_wincolor', {'rows': 8}) |
613 | - call term_wait(buf) | |
613 | + call TermWait(buf) | |
614 | 614 | call term_sendkeys(buf, "2G5lvj") |
615 | - call term_wait(buf) | |
615 | + call TermWait(buf) | |
616 | 616 | |
617 | 617 | call VerifyScreenDump(buf, 'Test_wincolor_01', {}) |
618 | 618 |
@@ -662,7 +662,7 @@ | ||
662 | 662 | call writefile(lines, 'Xtest_colorcolumn') |
663 | 663 | let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10}) |
664 | 664 | call term_sendkeys(buf, ":\<CR>") |
665 | - call term_wait(buf) | |
665 | + call TermWait(buf) | |
666 | 666 | call VerifyScreenDump(buf, 'Test_colorcolumn_1', {}) |
667 | 667 | |
668 | 668 | " clean up |
@@ -402,7 +402,7 @@ | ||
402 | 402 | |
403 | 403 | call writefile(lines, 'Xpumscript') |
404 | 404 | let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10}) |
405 | - call term_wait(buf, 100) | |
405 | + call TermWait(buf, 50) | |
406 | 406 | call term_sendkeys(buf, "a\<C-N>") |
407 | 407 | call VerifyScreenDump(buf, 'Test_pum_with_folds_two_tabs', {}) |
408 | 408 |
@@ -427,9 +427,9 @@ | ||
427 | 427 | |
428 | 428 | call writefile(lines, 'Xpreviewscript') |
429 | 429 | let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12}) |
430 | - call term_wait(buf, 100) | |
430 | + call TermWait(buf, 50) | |
431 | 431 | call term_sendkeys(buf, "Gi\<C-X>\<C-O>") |
432 | - call term_wait(buf, 200) | |
432 | + call TermWait(buf, 100) | |
433 | 433 | call term_sendkeys(buf, "\<C-N>") |
434 | 434 | call VerifyScreenDump(buf, 'Test_pum_with_preview_win', {}) |
435 | 435 |
@@ -430,9 +430,9 @@ | ||
430 | 430 | |
431 | 431 | " GC must not run during map-expr processing, which can make Vim crash. |
432 | 432 | call term_sendkeys(buf, '!') |
433 | - call term_wait(buf, 100) | |
433 | + call TermWait(buf, 50) | |
434 | 434 | call term_sendkeys(buf, "\<CR>") |
435 | - call term_wait(buf, 100) | |
435 | + call TermWait(buf, 50) | |
436 | 436 | call assert_equal('run', job_status(job)) |
437 | 437 | |
438 | 438 | call term_sendkeys(buf, ":qall!\<CR>") |
@@ -510,7 +510,7 @@ | ||
510 | 510 | END |
511 | 511 | call writefile(lines, 'XtestExprMap') |
512 | 512 | let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10}) |
513 | - call term_wait(buf) | |
513 | + call TermWait(buf) | |
514 | 514 | call term_sendkeys(buf, "\<C-B>") |
515 | 515 | call VerifyScreenDump(buf, 'Test_map_expr_1', {}) |
516 | 516 |
@@ -289,7 +289,7 @@ | ||
289 | 289 | END |
290 | 290 | call writefile(lines, 'XscriptMatchCommon') |
291 | 291 | let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12}) |
292 | - call term_wait(buf) | |
292 | + call TermWait(buf) | |
293 | 293 | return buf |
294 | 294 | endfunc |
295 | 295 |
@@ -298,14 +298,14 @@ | ||
298 | 298 | END |
299 | 299 | call writefile(lines, 'Xcolesearch') |
300 | 300 | let buf = RunVimInTerminal('Xcolesearch', {}) |
301 | - call term_wait(buf, 100) | |
301 | + call TermWait(buf, 50) | |
302 | 302 | |
303 | 303 | " Jump to something that is beyond the bottom of the window, |
304 | 304 | " so there's a scroll down. |
305 | 305 | call term_sendkeys(buf, ":so %\<CR>") |
306 | - call term_wait(buf, 100) | |
306 | + call TermWait(buf, 50) | |
307 | 307 | call term_sendkeys(buf, "/expr\<CR>") |
308 | - call term_wait(buf, 100) | |
308 | + call TermWait(buf, 50) | |
309 | 309 | |
310 | 310 | " Are the concealed parts of the current line really hidden? |
311 | 311 | let cursor_row = term_scrape(buf, '.')->map({_, e -> e.chars})->join('') |
@@ -335,7 +335,7 @@ | ||
335 | 335 | " Horizontal scroll would center the cursor in the screen line, but conceal |
336 | 336 | " makes it go to screen column 1. |
337 | 337 | call term_sendkeys(buf, "$") |
338 | - call term_wait(buf) | |
338 | + call TermWait(buf) | |
339 | 339 | |
340 | 340 | " Are the concealed parts of the current line really hidden? |
341 | 341 | call WaitForAssert({-> assert_equal('c', term_getline(buf, '.'))}) |
@@ -114,7 +114,7 @@ | ||
114 | 114 | |
115 | 115 | let rows = 10 |
116 | 116 | let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows}) |
117 | - call term_wait(buf, 200) | |
117 | + call TermWait(buf, 100) | |
118 | 118 | call assert_equal('run', job_status(term_getjob(buf))) |
119 | 119 | |
120 | 120 | call term_sendkeys(buf, "i") |
@@ -143,7 +143,7 @@ | ||
143 | 143 | |
144 | 144 | let rows = 10 |
145 | 145 | let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows}) |
146 | - call term_wait(buf, 200) | |
146 | + call WaitForAssert({-> assert_match('0,0-1\s*All$', term_getline(buf, rows - 1))}) | |
147 | 147 | call assert_equal('run', job_status(term_getjob(buf))) |
148 | 148 | |
149 | 149 | call term_sendkeys(buf, "i") |
@@ -280,7 +280,7 @@ | ||
280 | 280 | |
281 | 281 | " Check that the balloon shows up after a mouse move |
282 | 282 | let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50}) |
283 | - call term_wait(buf, 100) | |
283 | + call TermWait(buf, 50) | |
284 | 284 | " Default colors |
285 | 285 | call VerifyScreenDump(buf, 'Test_relnr_colors_1', {}) |
286 | 286 |
@@ -683,11 +683,11 @@ | ||
683 | 683 | |
684 | 684 | call term_sendkeys(buf, "Gi\<c-x>") |
685 | 685 | call term_sendkeys(buf, "\<c-v>") |
686 | - call term_wait(buf, 100) | |
686 | + call TermWait(buf, 50) | |
687 | 687 | " popup first entry "!" must be at the top |
688 | 688 | call WaitForAssert({-> assert_match('^!\s*$', term_getline(buf, 1))}) |
689 | 689 | exe 'resize +' . (h - 1) |
690 | - call term_wait(buf, 100) | |
690 | + call TermWait(buf, 50) | |
691 | 691 | redraw! |
692 | 692 | " popup shifted down, first line is now empty |
693 | 693 | call WaitForAssert({-> assert_equal('', term_getline(buf, 1))}) |
@@ -750,11 +750,11 @@ | ||
750 | 750 | let buf = RunVimInTerminal('-S Xscript', {}) |
751 | 751 | |
752 | 752 | " wait for the script to finish |
753 | - call term_wait(buf) | |
753 | + call TermWait(buf) | |
754 | 754 | |
755 | 755 | " Test that popup and previewwindow do not overlap. |
756 | 756 | call term_sendkeys(buf, "o") |
757 | - call term_wait(buf, 100) | |
757 | + call TermWait(buf, 50) | |
758 | 758 | call term_sendkeys(buf, "\<C-X>\<C-N>") |
759 | 759 | call VerifyScreenDump(buf, 'Test_popup_and_previewwindow_01', {}) |
760 | 760 |
@@ -65,9 +65,9 @@ | ||
65 | 65 | |
66 | 66 | " clear all popups after moving the cursor a bit, so that ruler is updated |
67 | 67 | call term_sendkeys(buf, "axxx\<Esc>") |
68 | - call term_wait(buf) | |
68 | + call TermWait(buf) | |
69 | 69 | call term_sendkeys(buf, "0") |
70 | - call term_wait(buf) | |
70 | + call TermWait(buf) | |
71 | 71 | call term_sendkeys(buf, ":call popup_clear()\<CR>") |
72 | 72 | call VerifyScreenDump(buf, 'Test_popupwin_08', {}) |
73 | 73 |
@@ -1389,7 +1389,7 @@ | ||
1389 | 1389 | END |
1390 | 1390 | call writefile(lines, 'XtestPopupBeval') |
1391 | 1391 | let buf = RunVimInTerminal('-S XtestPopupBeval', #{rows: 10}) |
1392 | - call term_wait(buf, 100) | |
1392 | + call TermWait(buf, 50) | |
1393 | 1393 | call term_sendkeys(buf, 'j') |
1394 | 1394 | call term_sendkeys(buf, ":call Hover()\<CR>") |
1395 | 1395 | call VerifyScreenDump(buf, 'Test_popupwin_beval_1', {}) |
@@ -2958,7 +2958,7 @@ | ||
2958 | 2958 | call writefile(lines, 'XtestInfoPopup') |
2959 | 2959 | |
2960 | 2960 | let buf = RunVimInTerminal('-S XtestInfoPopup', #{rows: 14}) |
2961 | - call term_wait(buf, 50) | |
2961 | + call TermWait(buf, 25) | |
2962 | 2962 | |
2963 | 2963 | call term_sendkeys(buf, "A\<C-X>\<C-U>") |
2964 | 2964 | call VerifyScreenDump(buf, 'Test_popupwin_infopopup_1', {}) |
@@ -3006,7 +3006,7 @@ | ||
3006 | 3006 | call writefile(lines, 'XtestInfoPopupNb') |
3007 | 3007 | |
3008 | 3008 | let buf = RunVimInTerminal('-S XtestInfoPopupNb', #{rows: 14}) |
3009 | - call term_wait(buf, 50) | |
3009 | + call TermWait(buf, 25) | |
3010 | 3010 | |
3011 | 3011 | call term_sendkeys(buf, "A\<C-X>\<C-U>") |
3012 | 3012 | call VerifyScreenDump(buf, 'Test_popupwin_infopopup_nb_1', {}) |
@@ -3024,7 +3024,7 @@ | ||
3024 | 3024 | call writefile(lines, 'XtestInfoPopupNb') |
3025 | 3025 | |
3026 | 3026 | let buf = RunVimInTerminal('-S XtestInfoPopupNb', #{rows: 14}) |
3027 | - call term_wait(buf, 50) | |
3027 | + call TermWait(buf, 25) | |
3028 | 3028 | |
3029 | 3029 | call term_sendkeys(buf, "A\<C-X>\<C-U>") |
3030 | 3030 | call term_sendkeys(buf, "\<C-N>") |
@@ -3055,7 +3055,7 @@ | ||
3055 | 3055 | call writefile(lines, 'XtestInfoPopupHidden') |
3056 | 3056 | |
3057 | 3057 | let buf = RunVimInTerminal('-S XtestInfoPopupHidden', #{rows: 14}) |
3058 | - call term_wait(buf, 50) | |
3058 | + call TermWait(buf, 25) | |
3059 | 3059 | |
3060 | 3060 | call term_sendkeys(buf, "A\<C-X>\<C-U>") |
3061 | 3061 | call VerifyScreenDump(buf, 'Test_popupwin_infopopup_hidden_1', {}) |
@@ -3113,7 +3113,7 @@ | ||
3113 | 3113 | |
3114 | 3114 | call writefile(lines, 'XtestInfoPopupWide') |
3115 | 3115 | let buf = RunVimInTerminal('-S XtestInfoPopupWide', #{rows: 8}) |
3116 | - call term_wait(buf, 50) | |
3116 | + call TermWait(buf, 25) | |
3117 | 3117 | |
3118 | 3118 | call term_sendkeys(buf, "Ascr\<C-X>\<C-O>") |
3119 | 3119 | call VerifyScreenDump(buf, 'Test_popupwin_infopopup_wide_1', {}) |
@@ -541,7 +541,7 @@ | ||
541 | 541 | \ .. "endfunc\<CR>") |
542 | 542 | call term_sendkeys(buf, ":profile func DoSomething\<CR>") |
543 | 543 | call term_sendkeys(buf, ":call DoSomething()\<CR>") |
544 | - call term_wait(buf, 200) | |
544 | + call TermWait(buf, 100) | |
545 | 545 | call StopVimInTerminal(buf) |
546 | 546 | let lines = readfile('XprofileTypedFunc') |
547 | 547 | call assert_equal("FUNCTION DoSomething()", lines[0]) |
@@ -672,7 +672,7 @@ | ||
672 | 672 | call term_sendkeys(buf, "/vim\<cr>") |
673 | 673 | call term_sendkeys(buf, "/b\<esc>") |
674 | 674 | call term_sendkeys(buf, "gg0") |
675 | - call term_wait(buf, 500) | |
675 | + call TermWait(buf, 250) | |
676 | 676 | let screen_line = term_scrape(buf, 1) |
677 | 677 | let [a0,a1,a2,a3] = [screen_line[3].attr, screen_line[4].attr, |
678 | 678 | \ screen_line[18].attr, screen_line[19].attr] |
@@ -792,12 +792,12 @@ | ||
792 | 792 | |
793 | 793 | call WaitForAssert({-> assert_equal(lines, [term_getline(buf, 1), term_getline(buf, 2)])}) |
794 | 794 | " wait for vim to complete initialization |
795 | - call term_wait(buf) | |
795 | + call TermWait(buf) | |
796 | 796 | |
797 | 797 | " Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight |
798 | 798 | call term_sendkeys(buf, ":set incsearch hlsearch\<cr>") |
799 | 799 | call term_sendkeys(buf, '/b') |
800 | - call term_wait(buf, 200) | |
800 | + call TermWait(buf, 100) | |
801 | 801 | let screen_line1 = term_scrape(buf, 1) |
802 | 802 | call assert_true(len(screen_line1) > 2) |
803 | 803 | " a0: attr_normal |
@@ -813,7 +813,7 @@ | ||
813 | 813 | |
814 | 814 | " Test incremental highlight search |
815 | 815 | call term_sendkeys(buf, "/vim") |
816 | - call term_wait(buf, 200) | |
816 | + call TermWait(buf, 100) | |
817 | 817 | " Buffer: |
818 | 818 | " abb vim vim vi |
819 | 819 | " vimvivim |
@@ -825,7 +825,7 @@ | ||
825 | 825 | |
826 | 826 | " Test <C-g> |
827 | 827 | call term_sendkeys(buf, "\<C-g>\<C-g>") |
828 | - call term_wait(buf, 200) | |
828 | + call TermWait(buf, 100) | |
829 | 829 | let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0] |
830 | 830 | let attr_line2 = [a1,a1,a1,a0,a0,a2,a2,a2] |
831 | 831 | call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) |
@@ -833,7 +833,7 @@ | ||
833 | 833 | |
834 | 834 | " Test <C-t> |
835 | 835 | call term_sendkeys(buf, "\<C-t>") |
836 | - call term_wait(buf, 200) | |
836 | + call TermWait(buf, 100) | |
837 | 837 | let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a1,a1,a1,a0,a0,a0] |
838 | 838 | let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2] |
839 | 839 | call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) |
@@ -841,7 +841,7 @@ | ||
841 | 841 | |
842 | 842 | " Type Enter and a1(incsearch highlight) should become a2(hlsearch highlight) |
843 | 843 | call term_sendkeys(buf, "\<cr>") |
844 | - call term_wait(buf, 200) | |
844 | + call TermWait(buf, 100) | |
845 | 845 | let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0] |
846 | 846 | let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2] |
847 | 847 | call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) |
@@ -851,7 +851,7 @@ | ||
851 | 851 | call term_sendkeys(buf, ":1\<cr>") |
852 | 852 | call term_sendkeys(buf, ":set nohlsearch\<cr>") |
853 | 853 | call term_sendkeys(buf, "/vim") |
854 | - call term_wait(buf, 200) | |
854 | + call TermWait(buf, 100) | |
855 | 855 | let attr_line1 = [a0,a0,a0,a0,a1,a1,a1,a0,a0,a0,a0,a0,a0,a0] |
856 | 856 | let attr_line2 = [a0,a0,a0,a0,a0,a0,a0,a0] |
857 | 857 | call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) |
@@ -202,12 +202,12 @@ | ||
202 | 202 | END |
203 | 203 | call writefile(lines, 'Xsearchstat') |
204 | 204 | let buf = RunVimInTerminal('-S Xsearchstat', #{rows: 10}) |
205 | - call term_wait(buf) | |
205 | + call TermWait(buf) | |
206 | 206 | call VerifyScreenDump(buf, 'Test_searchstat_1', {}) |
207 | 207 | |
208 | 208 | call term_sendkeys(buf, ":nnoremap <silent> n n\<cr>") |
209 | 209 | call term_sendkeys(buf, "gg0n") |
210 | - call term_wait(buf) | |
210 | + call TermWait(buf) | |
211 | 211 | call VerifyScreenDump(buf, 'Test_searchstat_2', {}) |
212 | 212 | |
213 | 213 | call StopVimInTerminal(buf) |
@@ -795,9 +795,9 @@ | ||
795 | 795 | let cmd = GetVimCommandCleanTerm() . ' -u Xvimrc_missing -S Xafter' |
796 | 796 | let buf = term_start(cmd, {'term_rows' : 10}) |
797 | 797 | call WaitForAssert({-> assert_equal("running", term_getstatus(buf))}) |
798 | - call term_wait(buf) | |
798 | + call TermWait(buf) | |
799 | 799 | call term_sendkeys(buf, "\n:") |
800 | - call term_wait(buf) | |
800 | + call TermWait(buf) | |
801 | 801 | call WaitForAssert({-> assert_match(':', term_getline(buf, 10))}) |
802 | 802 | call StopVimInTerminal(buf) |
803 | 803 | call assert_equal([], readfile('Xtestout')) |
@@ -74,7 +74,7 @@ | ||
74 | 74 | \ 'redraw', |
75 | 75 | \ ], 'Xscript') |
76 | 76 | let buf = RunVimInTerminal('-S Xscript', {}) |
77 | - call term_wait(buf) | |
77 | + call TermWait(buf) | |
78 | 78 | call term_sendkeys(buf, "S\<C-R>=&ambiwidth\<CR>\<Esc>") |
79 | 79 | call WaitForAssert({-> assert_match('single', term_getline(buf, 1))}) |
80 | 80 |
@@ -406,7 +406,7 @@ | ||
406 | 406 | call writefile(lines, 'XTest_statusline') |
407 | 407 | |
408 | 408 | let buf = RunVimInTerminal('-S XTest_statusline', {'rows': 10, 'cols': 50}) |
409 | - call term_wait(buf, 100) | |
409 | + call TermWait(buf, 50) | |
410 | 410 | call VerifyScreenDump(buf, 'Test_statusline_1', {}) |
411 | 411 | |
412 | 412 | " clean up |
@@ -53,7 +53,7 @@ | ||
53 | 53 | |
54 | 54 | " Quit gracefully to dump coverage information. |
55 | 55 | call term_sendkeys(buf, ":qall!\<CR>") |
56 | - call term_wait(buf) | |
56 | + call TermWait(buf) | |
57 | 57 | " Wait until Vim actually exited and shell shows a prompt |
58 | 58 | call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))}) |
59 | 59 | call StopShellInTerminal(buf) |
@@ -363,14 +363,14 @@ | ||
363 | 363 | call term_sendkeys(buf, ":set nomore\n") |
364 | 364 | call term_sendkeys(buf, ":set noruler\n") |
365 | 365 | call term_sendkeys(buf, ":split Xfile1\n") |
366 | - call term_wait(buf) | |
366 | + call TermWait(buf) | |
367 | 367 | call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))}) |
368 | 368 | call term_sendkeys(buf, "q") |
369 | - call term_wait(buf) | |
369 | + call TermWait(buf) | |
370 | 370 | call term_sendkeys(buf, ":\<CR>") |
371 | 371 | call WaitForAssert({-> assert_match('^:$', term_getline(buf, 20))}) |
372 | 372 | call term_sendkeys(buf, ":echomsg winnr('$')\<CR>") |
373 | - call term_wait(buf) | |
373 | + call TermWait(buf) | |
374 | 374 | call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))}) |
375 | 375 | call StopVimInTerminal(buf) |
376 | 376 | %bwipe! |
@@ -544,7 +544,7 @@ | ||
544 | 544 | call writefile(lines, 'XTest_tselect') |
545 | 545 | let buf = RunVimInTerminal('-S XTest_tselect', {'rows': 10, 'cols': 50}) |
546 | 546 | |
547 | - call term_wait(buf, 100) | |
547 | + call TermWait(buf, 50) | |
548 | 548 | call term_sendkeys(buf, ":tselect main\<CR>2\<CR>") |
549 | 549 | call VerifyScreenDump(buf, 'Test_tselect_1', {}) |
550 | 550 |
@@ -44,7 +44,7 @@ | ||
44 | 44 | call assert_notmatch('%[^\n]*running]', execute('ls ?')) |
45 | 45 | |
46 | 46 | call StopShellInTerminal(buf) |
47 | - call term_wait(buf) | |
47 | + call TermWait(buf) | |
48 | 48 | call assert_equal('n', mode()) |
49 | 49 | call assert_match('%aF[^\n]*finished]', execute('ls')) |
50 | 50 | call assert_match('%aF[^\n]*finished]', execute('ls F')) |
@@ -79,7 +79,7 @@ | ||
79 | 79 | func Test_terminal_make_change() |
80 | 80 | let buf = Run_shell_in_terminal({}) |
81 | 81 | call StopShellInTerminal(buf) |
82 | - call term_wait(buf) | |
82 | + call TermWait(buf) | |
83 | 83 | |
84 | 84 | setlocal modifiable |
85 | 85 | exe "normal Axxx\<Esc>" |
@@ -117,10 +117,10 @@ | ||
117 | 117 | |
118 | 118 | func Test_terminal_split_quit() |
119 | 119 | let buf = Run_shell_in_terminal({}) |
120 | - call term_wait(buf) | |
120 | + call TermWait(buf) | |
121 | 121 | split |
122 | 122 | quit! |
123 | - call term_wait(buf) | |
123 | + call TermWait(buf) | |
124 | 124 | sleep 50m |
125 | 125 | call assert_equal('run', job_status(g:job)) |
126 | 126 |
@@ -225,7 +225,7 @@ | ||
225 | 225 | " Nothing happens with invalid buffer number |
226 | 226 | call term_wait(1234) |
227 | 227 | |
228 | - call term_wait(buf) | |
228 | + call TermWait(buf) | |
229 | 229 | " On MS-Windows we first get a startup message of two lines, wait for the |
230 | 230 | " "cls" to happen, after that we have one line with three characters. |
231 | 231 | call WaitForAssert({-> assert_equal(3, len(term_scrape(buf, 1)))}) |
@@ -234,7 +234,7 @@ | ||
234 | 234 | " Must still work after the job ended. |
235 | 235 | let job = term_getjob(buf) |
236 | 236 | call WaitForAssert({-> assert_equal("dead", job_status(job))}) |
237 | - call term_wait(buf) | |
237 | + call TermWait(buf) | |
238 | 238 | call Check_123(buf) |
239 | 239 | |
240 | 240 | exe buf . 'bwipe' |
@@ -270,7 +270,7 @@ | ||
270 | 270 | |
271 | 271 | let job = term_getjob(buf) |
272 | 272 | call WaitForAssert({-> assert_equal("dead", job_status(job))}) |
273 | - call term_wait(buf) | |
273 | + call TermWait(buf) | |
274 | 274 | |
275 | 275 | exe buf . 'bwipe' |
276 | 276 | call delete('Xtext') |
@@ -287,7 +287,7 @@ | ||
287 | 287 | |
288 | 288 | let job = term_getjob(buf) |
289 | 289 | call WaitForAssert({-> assert_equal("dead", job_status(job))}) |
290 | - call term_wait(buf) | |
290 | + call TermWait(buf) | |
291 | 291 | |
292 | 292 | " wait until the scrolling stops |
293 | 293 | while 1 |
@@ -325,7 +325,7 @@ | ||
325 | 325 | call assert_inrange(91, 100, lines) |
326 | 326 | |
327 | 327 | call StopShellInTerminal(buf) |
328 | - call term_wait(buf) | |
328 | + call TermWait(buf) | |
329 | 329 | exe buf . 'bwipe' |
330 | 330 | set termwinscroll& |
331 | 331 | call delete('Xtext') |
@@ -359,10 +359,10 @@ | ||
359 | 359 | |
360 | 360 | " stop "tail -f" |
361 | 361 | call term_sendkeys(buf, "\<C-C>") |
362 | - call term_wait(buf, 50) | |
362 | + call TermWait(buf, 25) | |
363 | 363 | " stop shell |
364 | 364 | call term_sendkeys(buf, "exit\<CR>") |
365 | - call term_wait(buf, 100) | |
365 | + call TermWait(buf, 50) | |
366 | 366 | " close terminal window |
367 | 367 | let tsk_ret = term_sendkeys(buf, ":q\<CR>") |
368 | 368 |
@@ -622,7 +622,7 @@ | ||
622 | 622 | else |
623 | 623 | call term_sendkeys(buf, "echo $" . a:name . "\r") |
624 | 624 | endif |
625 | - call term_wait(buf) | |
625 | + call TermWait(buf) | |
626 | 626 | call StopShellInTerminal(buf) |
627 | 627 | call WaitForAssert({-> assert_equal(a:value, getline(2))}) |
628 | 628 |
@@ -639,7 +639,7 @@ | ||
639 | 639 | else |
640 | 640 | call term_sendkeys(buf, "echo $TESTENV\r") |
641 | 641 | endif |
642 | - eval buf->term_wait() | |
642 | + eval buf->TermWait() | |
643 | 643 | call StopShellInTerminal(buf) |
644 | 644 | call WaitForAssert({-> assert_equal('correct', getline(2))}) |
645 | 645 |
@@ -688,7 +688,7 @@ | ||
688 | 688 | |
689 | 689 | let g:job = term_getjob(buf) |
690 | 690 | call StopShellInTerminal(buf) |
691 | - call term_wait(buf) | |
691 | + call TermWait(buf) | |
692 | 692 | unlet g:job |
693 | 693 | bwipe |
694 | 694 | endfunc |
@@ -813,7 +813,7 @@ | ||
813 | 813 | func Test_terminal_redir_file() |
814 | 814 | let cmd = Get_cat_123_cmd() |
815 | 815 | let buf = term_start(cmd, {'out_io': 'file', 'out_name': 'Xfile'}) |
816 | - call term_wait(buf) | |
816 | + call TermWait(buf) | |
817 | 817 | " ConPTY may precede escape sequence. There are things that are not so. |
818 | 818 | if !has('conpty') |
819 | 819 | call WaitForAssert({-> assert_notequal(0, len(readfile("Xfile")))}) |
@@ -827,7 +827,7 @@ | ||
827 | 827 | if has('unix') |
828 | 828 | call writefile(['one line'], 'Xfile') |
829 | 829 | let buf = term_start('cat', {'in_io': 'file', 'in_name': 'Xfile'}) |
830 | - call term_wait(buf) | |
830 | + call TermWait(buf) | |
831 | 831 | call WaitForAssert({-> assert_equal('one line', term_getline(buf, 1))}) |
832 | 832 | let g:job = term_getjob(buf) |
833 | 833 | call WaitForAssert({-> assert_equal('dead', job_status(g:job))}) |
@@ -860,7 +860,7 @@ | ||
860 | 860 | |
861 | 861 | call term_sendkeys(buf, "\r") |
862 | 862 | call StopShellInTerminal(buf) |
863 | - call term_wait(buf) | |
863 | + call TermWait(buf) | |
864 | 864 | |
865 | 865 | tunmap 123 |
866 | 866 | tunmap 456 |
@@ -878,7 +878,7 @@ | ||
878 | 878 | let buf = Run_shell_in_terminal({}) |
879 | 879 | wall |
880 | 880 | call StopShellInTerminal(buf) |
881 | - call term_wait(buf) | |
881 | + call TermWait(buf) | |
882 | 882 | exe buf . 'bwipe' |
883 | 883 | unlet g:job |
884 | 884 | endfunc |
@@ -887,7 +887,7 @@ | ||
887 | 887 | let buf = Run_shell_in_terminal({}) |
888 | 888 | call assert_fails('wqall', 'E948') |
889 | 889 | call StopShellInTerminal(buf) |
890 | - call term_wait(buf) | |
890 | + call TermWait(buf) | |
891 | 891 | exe buf . 'bwipe' |
892 | 892 | unlet g:job |
893 | 893 | endfunc |
@@ -908,7 +908,7 @@ | ||
908 | 908 | enew |
909 | 909 | let buf = term_start(cmd, {'curwin': bufnr('')}) |
910 | 910 | let g:job = term_getjob(buf) |
911 | - call term_wait(buf, 50) | |
911 | + call TermWait(buf, 25) | |
912 | 912 | |
913 | 913 | if has('win32') |
914 | 914 | call assert_equal('cmd', job_info(g:job).cmd[0]) |
@@ -919,7 +919,7 @@ | ||
919 | 919 | " ascii + composing |
920 | 920 | let txt = "a\u0308bc" |
921 | 921 | call term_sendkeys(buf, "echo " . txt . "\r") |
922 | - call term_wait(buf, 50) | |
922 | + call TermWait(buf, 25) | |
923 | 923 | call assert_match("echo " . txt, term_getline(buf, lnum[0])) |
924 | 924 | call assert_equal(txt, term_getline(buf, lnum[0] + 1)) |
925 | 925 | let l = term_scrape(buf, lnum[0] + 1) |
@@ -930,7 +930,7 @@ | ||
930 | 930 | " multibyte + composing |
931 | 931 | let txt = "\u304b\u3099\u304e\u304f\u3099\u3052\u3053\u3099" |
932 | 932 | call term_sendkeys(buf, "echo " . txt . "\r") |
933 | - call term_wait(buf, 50) | |
933 | + call TermWait(buf, 25) | |
934 | 934 | call assert_match("echo " . txt, term_getline(buf, lnum[1])) |
935 | 935 | call assert_equal(txt, term_getline(buf, lnum[1] + 1)) |
936 | 936 | let l = term_scrape(buf, lnum[1] + 1) |
@@ -943,7 +943,7 @@ | ||
943 | 943 | " \u00a0 + composing |
944 | 944 | let txt = "abc\u00a0\u0308" |
945 | 945 | call term_sendkeys(buf, "echo " . txt . "\r") |
946 | - call term_wait(buf, 50) | |
946 | + call TermWait(buf, 25) | |
947 | 947 | call assert_match("echo " . txt, term_getline(buf, lnum[2])) |
948 | 948 | call assert_equal(txt, term_getline(buf, lnum[2] + 1)) |
949 | 949 | let l = term_scrape(buf, lnum[2] + 1) |
@@ -1587,7 +1587,7 @@ | ||
1587 | 1587 | let buf = Run_shell_in_terminal({}) |
1588 | 1588 | call assert_equal(colors, term_getansicolors(buf)) |
1589 | 1589 | call StopShellInTerminal(buf) |
1590 | - call term_wait(buf) | |
1590 | + call TermWait(buf) | |
1591 | 1591 | |
1592 | 1592 | exe buf . 'bwipe' |
1593 | 1593 | endfunc |
@@ -1612,7 +1612,7 @@ | ||
1612 | 1612 | let buf = Run_shell_in_terminal({}) |
1613 | 1613 | call assert_equal(g:terminal_ansi_colors, term_getansicolors(buf)) |
1614 | 1614 | call StopShellInTerminal(buf) |
1615 | - call term_wait(buf) | |
1615 | + call TermWait(buf) | |
1616 | 1616 | |
1617 | 1617 | exe buf . 'bwipe' |
1618 | 1618 | unlet g:terminal_ansi_colors |
@@ -1646,7 +1646,7 @@ | ||
1646 | 1646 | call assert_fails('call term_setansicolors(buf, colors)', 'E474:') |
1647 | 1647 | |
1648 | 1648 | call StopShellInTerminal(buf) |
1649 | - call term_wait(buf) | |
1649 | + call TermWait(buf) | |
1650 | 1650 | exe buf . 'bwipe' |
1651 | 1651 | endfunc |
1652 | 1652 |
@@ -1742,7 +1742,7 @@ | ||
1742 | 1742 | let win = bufwinid(buf) |
1743 | 1743 | call assert_equal([winheight(win), winwidth(win)], term_getsize(buf)) |
1744 | 1744 | call StopShellInTerminal(buf) |
1745 | - call term_wait(buf) | |
1745 | + call TermWait(buf) | |
1746 | 1746 | exe buf . 'bwipe' |
1747 | 1747 | |
1748 | 1748 | set termwinsize=7x0 |
@@ -1750,7 +1750,7 @@ | ||
1750 | 1750 | let win = bufwinid(buf) |
1751 | 1751 | call assert_equal([7, winwidth(win)], term_getsize(buf)) |
1752 | 1752 | call StopShellInTerminal(buf) |
1753 | - call term_wait(buf) | |
1753 | + call TermWait(buf) | |
1754 | 1754 | exe buf . 'bwipe' |
1755 | 1755 | |
1756 | 1756 | set termwinsize=0x33 |
@@ -1758,7 +1758,7 @@ | ||
1758 | 1758 | let win = bufwinid(buf) |
1759 | 1759 | call assert_equal([winheight(win), 33], term_getsize(buf)) |
1760 | 1760 | call StopShellInTerminal(buf) |
1761 | - call term_wait(buf) | |
1761 | + call TermWait(buf) | |
1762 | 1762 | exe buf . 'bwipe' |
1763 | 1763 | |
1764 | 1764 | set termwinsize= |
@@ -1788,7 +1788,7 @@ | ||
1788 | 1788 | call assert_equal(30, winwidth(win)) |
1789 | 1789 | |
1790 | 1790 | call StopShellInTerminal(buf) |
1791 | - call term_wait(buf) | |
1791 | + call TermWait(buf) | |
1792 | 1792 | exe buf . 'bwipe' |
1793 | 1793 | |
1794 | 1794 | set termwinsize=0*0 |
@@ -1796,7 +1796,7 @@ | ||
1796 | 1796 | let win = bufwinid(buf) |
1797 | 1797 | call assert_equal([winheight(win), winwidth(win)], term_getsize(buf)) |
1798 | 1798 | call StopShellInTerminal(buf) |
1799 | - call term_wait(buf) | |
1799 | + call TermWait(buf) | |
1800 | 1800 | exe buf . 'bwipe' |
1801 | 1801 | |
1802 | 1802 | set termwinsize= |
@@ -1938,7 +1938,7 @@ | ||
1938 | 1938 | call assert_equal(1, winnr('$')) |
1939 | 1939 | let buf = Run_shell_in_terminal({'term_finish': 'close'}) |
1940 | 1940 | call StopShellInTerminal(buf) |
1941 | - call term_wait(buf) | |
1941 | + call TermWait(buf) | |
1942 | 1942 | |
1943 | 1943 | " closing window wipes out the terminal buffer a with finished job |
1944 | 1944 | call WaitForAssert({-> assert_equal(1, winnr('$'))}) |
@@ -2025,7 +2025,7 @@ | ||
2025 | 2025 | END |
2026 | 2026 | call writefile(lines, 'XtermNormal') |
2027 | 2027 | let buf = RunVimInTerminal('-S XtermNormal', {'rows': 8}) |
2028 | - call term_wait(buf) | |
2028 | + call TermWait(buf) | |
2029 | 2029 | |
2030 | 2030 | call term_sendkeys(buf, "\<C-W>N") |
2031 | 2031 | call term_sendkeys(buf, ":set number cursorline culopt=both\r") |
@@ -2215,7 +2215,7 @@ | ||
2215 | 2215 | call assert_equal('', term_gettty(buf + 1)) |
2216 | 2216 | |
2217 | 2217 | call StopShellInTerminal(buf) |
2218 | - call term_wait(buf) | |
2218 | + call TermWait(buf) | |
2219 | 2219 | exe buf . 'bwipe' |
2220 | 2220 | endfunc |
2221 | 2221 |
@@ -2255,7 +2255,7 @@ | ||
2255 | 2255 | \ 'echo getwinpos()', |
2256 | 2256 | \ ], 'XTest_getwinpos') |
2257 | 2257 | let buf = RunVimInTerminal('-S XTest_getwinpos', {'cols': 60}) |
2258 | - call term_wait(buf) | |
2258 | + call TermWait(buf) | |
2259 | 2259 | |
2260 | 2260 | " Find the output of getwinpos() in the bottom line. |
2261 | 2261 | let rows = term_getsize(buf)[0] |
@@ -2278,7 +2278,7 @@ | ||
2278 | 2278 | call assert_inrange(xroot + 2, xroot + xoff, xpos) |
2279 | 2279 | call assert_inrange(yroot + 2, yroot + yoff, ypos) |
2280 | 2280 | |
2281 | - call term_wait(buf) | |
2281 | + call TermWait(buf) | |
2282 | 2282 | call term_sendkeys(buf, ":q\<CR>") |
2283 | 2283 | call StopVimInTerminal(buf) |
2284 | 2284 | call delete('XTest_getwinpos') |
@@ -2434,11 +2434,11 @@ | ||
2434 | 2434 | \ ] |
2435 | 2435 | call writefile(lines, 'XtermPopup') |
2436 | 2436 | let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15}) |
2437 | - call term_wait(buf, 200) | |
2437 | + call TermWait(buf, 100) | |
2438 | 2438 | call term_sendkeys(buf, ":call OpenTerm(0)\<CR>") |
2439 | - call term_wait(buf, 200) | |
2439 | + call TermWait(buf, 100) | |
2440 | 2440 | call term_sendkeys(buf, ":\<CR>") |
2441 | - call term_wait(buf, 200) | |
2441 | + call TermWait(buf, 100) | |
2442 | 2442 | call term_sendkeys(buf, "\<C-W>:echo getwinvar(g:winid, \"&buftype\") win_gettype(g:winid)\<CR>") |
2443 | 2443 | call VerifyScreenDump(buf, 'Test_terminal_popup_1', {}) |
2444 | 2444 |
@@ -2446,7 +2446,7 @@ | ||
2446 | 2446 | call VerifyScreenDump(buf, 'Test_terminal_popup_2', {}) |
2447 | 2447 | |
2448 | 2448 | call term_sendkeys(buf, ":call OpenTerm(1)\<CR>") |
2449 | - call term_wait(buf, 300) | |
2449 | + call TermWait(buf, 150) | |
2450 | 2450 | call term_sendkeys(buf, ":set hlsearch\<CR>") |
2451 | 2451 | call term_sendkeys(buf, "/edit\<CR>") |
2452 | 2452 | call VerifyScreenDump(buf, 'Test_terminal_popup_3', {}) |
@@ -2454,7 +2454,7 @@ | ||
2454 | 2454 | call term_sendkeys(buf, "\<C-W>:call HidePopup()\<CR>") |
2455 | 2455 | call VerifyScreenDump(buf, 'Test_terminal_popup_4', {}) |
2456 | 2456 | call term_sendkeys(buf, "\<CR>") |
2457 | - call term_wait(buf, 100) | |
2457 | + call TermWait(buf, 50) | |
2458 | 2458 | |
2459 | 2459 | call term_sendkeys(buf, "\<C-W>:call ClosePopup()\<CR>") |
2460 | 2460 | call VerifyScreenDump(buf, 'Test_terminal_popup_5', {}) |
@@ -2470,9 +2470,9 @@ | ||
2470 | 2470 | call term_sendkeys(buf, "A") |
2471 | 2471 | call VerifyScreenDump(buf, 'Test_terminal_popup_8', {}) |
2472 | 2472 | |
2473 | - call term_wait(buf, 100) | |
2473 | + call TermWait(buf, 50) | |
2474 | 2474 | call term_sendkeys(buf, ":q\<CR>") |
2475 | - call term_wait(buf, 200) " wait for terminal to vanish | |
2475 | + call TermWait(buf, 100) " wait for terminal to vanish | |
2476 | 2476 | |
2477 | 2477 | call StopVimInTerminal(buf) |
2478 | 2478 | call delete('Xtext') |
@@ -2499,16 +2499,16 @@ | ||
2499 | 2499 | \ ] |
2500 | 2500 | call writefile(lines, 'XtermPopup') |
2501 | 2501 | let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15}) |
2502 | - call term_wait(buf, 200) | |
2502 | + call TermWait(buf, 100) | |
2503 | 2503 | call term_sendkeys(buf, ":set noruler\<CR>") |
2504 | 2504 | call term_sendkeys(buf, ":call OpenTerm()\<CR>") |
2505 | - call term_wait(buf, 100) | |
2505 | + call TermWait(buf, 50) | |
2506 | 2506 | call term_sendkeys(buf, ":\<CR>") |
2507 | 2507 | call VerifyScreenDump(buf, 'Test_terminal_popup_m1', {}) |
2508 | 2508 | |
2509 | - call term_wait(buf, 100) | |
2509 | + call TermWait(buf, 50) | |
2510 | 2510 | call term_sendkeys(buf, ":q\<CR>") |
2511 | - call term_wait(buf, 100) " wait for terminal to vanish | |
2511 | + call TermWait(buf, 50) " wait for terminal to vanish | |
2512 | 2512 | call StopVimInTerminal(buf) |
2513 | 2513 | call delete('Xtext') |
2514 | 2514 | call delete('XtermPopup') |
@@ -2531,17 +2531,17 @@ | ||
2531 | 2531 | \ ] |
2532 | 2532 | call writefile(lines, 'XtermPopup') |
2533 | 2533 | let buf = RunVimInTerminal('-S XtermPopup', #{rows: 15}) |
2534 | - call term_wait(buf, 200) | |
2534 | + call TermWait(buf, 100) | |
2535 | 2535 | call term_sendkeys(buf, ":set noruler\<CR>") |
2536 | 2536 | call term_sendkeys(buf, ":call OpenTerm()\<CR>") |
2537 | - call term_wait(buf, 100) | |
2537 | + call TermWait(buf, 50) | |
2538 | 2538 | call term_sendkeys(buf, "hello\<CR>") |
2539 | 2539 | call VerifyScreenDump(buf, 'Test_terminal_popup_' .. a:group_name, {}) |
2540 | 2540 | |
2541 | 2541 | call term_sendkeys(buf, "\<C-D>") |
2542 | - call term_wait(buf, 100) | |
2542 | + call TermWait(buf, 50) | |
2543 | 2543 | call term_sendkeys(buf, ":q\<CR>") |
2544 | - call term_wait(buf, 100) " wait for terminal to vanish | |
2544 | + call TermWait(buf, 50) " wait for terminal to vanish | |
2545 | 2545 | call StopVimInTerminal(buf) |
2546 | 2546 | call delete('XtermPopup') |
2547 | 2547 | endfunc |
@@ -2594,19 +2594,19 @@ | ||
2594 | 2594 | let g:buf1 = term_start('sh', #{hidden: 1, term_finish: 'close'}) |
2595 | 2595 | call popup_create(g:buf1, {}) |
2596 | 2596 | let g:buf2 = term_start(['sh', '-c'], #{curwin: 1, exit_cb: function('TermExit')}) |
2597 | - call term_wait(g:buf2, 100) | |
2597 | + call TermWait(g:buf2, 50) | |
2598 | 2598 | call popup_close(win_getid()) |
2599 | 2599 | endfunc |
2600 | 2600 | func TermExit(...) |
2601 | 2601 | let altbuf = bufnr('#') |
2602 | 2602 | call term_sendkeys(altbuf, "exit\<CR>") |
2603 | - call term_wait(altbuf) | |
2603 | + call TermWait(altbuf) | |
2604 | 2604 | call popup_close(win_getid()) |
2605 | 2605 | endfunc |
2606 | 2606 | call OpenTerms() |
2607 | 2607 | |
2608 | 2608 | call term_sendkeys(g:buf0, "exit\<CR>") |
2609 | - call term_wait(g:buf0, 100) | |
2609 | + call TermWait(g:buf0, 50) | |
2610 | 2610 | exe g:buf0 .. 'bwipe!' |
2611 | 2611 | set hidden& |
2612 | 2612 | endfunc |
@@ -10,7 +10,7 @@ | ||
10 | 10 | func Test_terminal_redir_fails() |
11 | 11 | if has('unix') |
12 | 12 | let buf = term_start('xyzabc', {'err_io': 'file', 'err_name': 'Xfile'}) |
13 | - call term_wait(buf) | |
13 | + call TermWait(buf) | |
14 | 14 | call WaitFor('len(readfile("Xfile")) > 0') |
15 | 15 | call assert_match('executing job failed', readfile('Xfile')[0]) |
16 | 16 | call WaitFor('!&modified') |
@@ -398,9 +398,9 @@ | ||
398 | 398 | call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))}) |
399 | 399 | |
400 | 400 | " GC must not run during timer callback, which can make Vim crash. |
401 | - call term_wait(buf, 100) | |
401 | + call TermWait(buf, 50) | |
402 | 402 | call term_sendkeys(buf, "\<CR>") |
403 | - call term_wait(buf, 100) | |
403 | + call TermWait(buf, 50) | |
404 | 404 | call assert_equal('run', job_status(job)) |
405 | 405 | |
406 | 406 | call term_sendkeys(buf, ":qall!\<CR>") |
@@ -1913,30 +1913,30 @@ | ||
1913 | 1913 | |
1914 | 1914 | " Deep nesting of if ... endif |
1915 | 1915 | call term_sendkeys(buf, ":call Test1()\n") |
1916 | - call term_wait(buf) | |
1916 | + call TermWait(buf) | |
1917 | 1917 | call WaitForAssert({-> assert_match('^E579:', term_getline(buf, 5))}) |
1918 | 1918 | |
1919 | 1919 | " Deep nesting of for ... endfor |
1920 | 1920 | call term_sendkeys(buf, ":call Test2()\n") |
1921 | - call term_wait(buf) | |
1921 | + call TermWait(buf) | |
1922 | 1922 | call WaitForAssert({-> assert_match('^E585:', term_getline(buf, 5))}) |
1923 | 1923 | |
1924 | 1924 | " Deep nesting of while ... endwhile |
1925 | 1925 | call term_sendkeys(buf, ":call Test3()\n") |
1926 | - call term_wait(buf) | |
1926 | + call TermWait(buf) | |
1927 | 1927 | call WaitForAssert({-> assert_match('^E585:', term_getline(buf, 5))}) |
1928 | 1928 | |
1929 | 1929 | " Deep nesting of try ... endtry |
1930 | 1930 | call term_sendkeys(buf, ":call Test4()\n") |
1931 | - call term_wait(buf) | |
1931 | + call TermWait(buf) | |
1932 | 1932 | call WaitForAssert({-> assert_match('^E601:', term_getline(buf, 5))}) |
1933 | 1933 | |
1934 | 1934 | " Deep nesting of function ... endfunction |
1935 | 1935 | call term_sendkeys(buf, ":call Test5()\n") |
1936 | - call term_wait(buf) | |
1936 | + call TermWait(buf) | |
1937 | 1937 | call WaitForAssert({-> assert_match('^E1058:', term_getline(buf, 4))}) |
1938 | 1938 | call term_sendkeys(buf, "\<C-C>\n") |
1939 | - call term_wait(buf) | |
1939 | + call TermWait(buf) | |
1940 | 1940 | |
1941 | 1941 | "let l = '' |
1942 | 1942 | "for i in range(1, 6) |
@@ -739,6 +739,8 @@ | ||
739 | 739 | static int included_patches[] = |
740 | 740 | { /* Add new patch number below this line */ |
741 | 741 | /**/ |
742 | + 533, | |
743 | +/**/ | |
742 | 744 | 532, |
743 | 745 | /**/ |
744 | 746 | 531, |