Mercurial > vim
diff src/testdir/test_search.vim @ 19954:c087099e9163 v8.2.0533
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
patch 8.2.0533: tests using term_wait() can still be flaky
Problem: Tests using term_wait() can still be flaky.
Solution: Increase the wait time when rerunning a test. (James McCoy,
closes #5899) Halve the initial times to make tests run faster
when there is no rerun.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 08 Apr 2020 22:00:05 +0200 |
parents | 9cbe3a4f1492 |
children | 0b42b5e50344 |
line wrap: on
line diff
--- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -672,7 +672,7 @@ func Test_search_cmdline8() call term_sendkeys(buf, "/vim\<cr>") call term_sendkeys(buf, "/b\<esc>") call term_sendkeys(buf, "gg0") - call term_wait(buf, 500) + call TermWait(buf, 250) let screen_line = term_scrape(buf, 1) let [a0,a1,a2,a3] = [screen_line[3].attr, screen_line[4].attr, \ screen_line[18].attr, screen_line[19].attr] @@ -792,12 +792,12 @@ func Test_search_cmdline_incsearch_highl call WaitForAssert({-> assert_equal(lines, [term_getline(buf, 1), term_getline(buf, 2)])}) " wait for vim to complete initialization - call term_wait(buf) + call TermWait(buf) " Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight call term_sendkeys(buf, ":set incsearch hlsearch\<cr>") call term_sendkeys(buf, '/b') - call term_wait(buf, 200) + call TermWait(buf, 100) let screen_line1 = term_scrape(buf, 1) call assert_true(len(screen_line1) > 2) " a0: attr_normal @@ -813,7 +813,7 @@ func Test_search_cmdline_incsearch_highl " Test incremental highlight search call term_sendkeys(buf, "/vim") - call term_wait(buf, 200) + call TermWait(buf, 100) " Buffer: " abb vim vim vi " vimvivim @@ -825,7 +825,7 @@ func Test_search_cmdline_incsearch_highl " Test <C-g> call term_sendkeys(buf, "\<C-g>\<C-g>") - call term_wait(buf, 200) + call TermWait(buf, 100) let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0] let attr_line2 = [a1,a1,a1,a0,a0,a2,a2,a2] call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) @@ -833,7 +833,7 @@ func Test_search_cmdline_incsearch_highl " Test <C-t> call term_sendkeys(buf, "\<C-t>") - call term_wait(buf, 200) + call TermWait(buf, 100) let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a1,a1,a1,a0,a0,a0] let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2] call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) @@ -841,7 +841,7 @@ func Test_search_cmdline_incsearch_highl " Type Enter and a1(incsearch highlight) should become a2(hlsearch highlight) call term_sendkeys(buf, "\<cr>") - call term_wait(buf, 200) + call TermWait(buf, 100) let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0] let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2] call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) @@ -851,7 +851,7 @@ func Test_search_cmdline_incsearch_highl call term_sendkeys(buf, ":1\<cr>") call term_sendkeys(buf, ":set nohlsearch\<cr>") call term_sendkeys(buf, "/vim") - call term_wait(buf, 200) + call TermWait(buf, 100) let attr_line1 = [a0,a0,a0,a0,a1,a1,a1,a0,a0,a0,a0,a0,a0,a0] let attr_line2 = [a0,a0,a0,a0,a0,a0,a0,a0] call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr'))