From 6f5ff5818abcfff4fce74f3972debc72704f8d49 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 15:20:19 +0800 Subject: vim-patch:8.1.2403: autocmd test fails under valgrind Problem: Autocmd test fails under valgrind. Solution: Wait a bit longer. https://github.com/vim/vim/commit/3c47e8384de62dd67748454a853677e32ee7842c Co-authored-by: Bram Moolenaar --- test/old/testdir/test_autocmd.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index 959efc0b49..3ac2b1fa5c 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -2982,9 +2982,9 @@ func Test_autocmd_SafeState() call WaitForAssert({-> assert_match('^xxxx', term_getline(buf, 6))}, 1000) call term_sendkeys(buf, ":let g:again = ''\:call CallTimer()\") - call term_wait(buf) + call term_wait(buf, 50) call term_sendkeys(buf, ":\") - call term_wait(buf) + call term_wait(buf, 50) call term_sendkeys(buf, ":echo g:again\") call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000) -- cgit From e8df2a012b3d54c3c39bdc8abbfdcdec6a402cf8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 14:55:13 +0800 Subject: vim-patch:8.2.0186: a couple of tests may fail when features are missing Problem: A couple of tests may fail when features are missing. Solution: Check for features. (Dominique Pelle, closes vim/vim#5561) https://github.com/vim/vim/commit/705724e430abd10ffdd5f1a2bb5a8f9223ff5cdd Just copy the two 'wincolor' test functions from Vim. Co-authored-by: Bram Moolenaar --- test/old/testdir/test_highlight.vim | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/test/old/testdir/test_highlight.vim b/test/old/testdir/test_highlight.vim index 14c208521b..4026302a5b 100644 --- a/test/old/testdir/test_highlight.vim +++ b/test/old/testdir/test_highlight.vim @@ -593,6 +593,57 @@ func Test_cursorline_with_visualmode() call delete('Xtest_cursorline_with_visualmode') endfunc +func Test_wincolor() + CheckScreendump + + let lines =<< trim END + set cursorline cursorcolumn rnu + call setline(1, ["","1111111111","22222222222","3 here 3","","the cat is out of the bag"]) + set wincolor=Pmenu + hi CatLine guifg=green ctermfg=green + hi Reverse gui=reverse cterm=reverse + syn match CatLine /^the.*/ + call prop_type_add("foo", {"highlight": "Reverse", "combine": 1}) + call prop_add(6, 12, {"type": "foo", "end_col": 15}) + /here + END + call writefile(lines, 'Xtest_wincolor') + let buf = RunVimInTerminal('-S Xtest_wincolor', {'rows': 8}) + call term_wait(buf) + call term_sendkeys(buf, "2G5lvj") + call term_wait(buf) + + call VerifyScreenDump(buf, 'Test_wincolor_01', {}) + + " clean up + call term_sendkeys(buf, "\") + call StopVimInTerminal(buf) + call delete('Xtest_wincolor') +endfunc + +func Test_wincolor_listchars() + CheckScreendump + CheckFeature conceal + + let lines =<< trim END + call setline(1, ["one","\t\tsome random text enough long to show 'extends' and 'precedes' includingnbsps, preceding tabs and trailing spaces ","three"]) + set wincolor=Todo + set nowrap cole=1 cocu+=n + set list lcs=eol:$,tab:>-,space:.,trail:_,extends:>,precedes:<,conceal:*,nbsp:# + call matchadd('Conceal', 'text') + normal 2G5zl + END + call writefile(lines, 'Xtest_wincolorlcs') + let buf = RunVimInTerminal('-S Xtest_wincolorlcs', {'rows': 8}) + + call VerifyScreenDump(buf, 'Test_wincolor_lcs', {}) + + " clean up + call term_sendkeys(buf, "\") + call StopVimInTerminal(buf) + call delete('Xtest_wincolorlcs') +endfunc + func Test_cursorcolumn_insert_on_tab() CheckScreendump -- cgit From 702a5f0cbb7782b596edce944fe4556046eea35e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 14:58:48 +0800 Subject: vim-patch:8.2.0195: some tests fail when run in the GUI Problem: Some tests fail when run in the GUI. Solution: Make sure the window width is enough. In the GUI run terminal Vim in the terminal, if possible. https://github.com/vim/vim/commit/3180fe6c6dc0728d21c6318b957022b029c234f0 Co-authored-by: Bram Moolenaar --- test/old/testdir/test_highlight.vim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/old/testdir/test_highlight.vim b/test/old/testdir/test_highlight.vim index 4026302a5b..b48c598970 100644 --- a/test/old/testdir/test_highlight.vim +++ b/test/old/testdir/test_highlight.vim @@ -595,6 +595,8 @@ endfunc func Test_wincolor() CheckScreendump + " make sure the width is enough for the test + set columns=80 let lines =<< trim END set cursorline cursorcolumn rnu -- cgit From 045cc185d5d7575515dafebffc3ea3e2a7023e4e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 15:21:00 +0800 Subject: vim-patch:8.2.0310: autocmd test fails on a slow system Problem: Autocmd test fails on a slow system. Solution: Adjust the expectations. (James McCoy, closes vim/vim#5685) https://github.com/vim/vim/commit/8fb1b47a5e24892b23c3923a07d8a850d99b14b2 Co-authored-by: Bram Moolenaar --- test/old/testdir/test_autocmd.vim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index 3ac2b1fa5c..fd95988de0 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -2974,17 +2974,19 @@ func Test_autocmd_SafeState() call writefile(lines, 'XSafeState') let buf = RunVimInTerminal('-S XSafeState', #{rows: 6}) - " Sometimes we loop to handle an K_IGNORE + " Sometimes we loop to handle a K_IGNORE, SafeState may be trigered once or + " more often. call term_sendkeys(buf, ":echo g:safe\") - call WaitForAssert({-> assert_match('^[12] ', term_getline(buf, 6))}, 1000) + call WaitForAssert({-> assert_match('^\d ', term_getline(buf, 6))}, 1000) + " SafeStateAgain should be invoked at least three times call term_sendkeys(buf, ":echo g:again\") - call WaitForAssert({-> assert_match('^xxxx', term_getline(buf, 6))}, 1000) + call WaitForAssert({-> assert_match('^xxx', term_getline(buf, 6))}, 1000) call term_sendkeys(buf, ":let g:again = ''\:call CallTimer()\") - call term_wait(buf, 50) + call term_wait(buf, 100) call term_sendkeys(buf, ":\") - call term_wait(buf, 50) + call term_wait(buf, 100) call term_sendkeys(buf, ":echo g:again\") call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000) -- cgit From ff37916b47658d16cdec6932aa8aaa3b5af674b7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 14:45:33 +0800 Subject: vim-patch:8.2.0454: some tests fail when the system is slow Problem: Some tests fail when the system is slow. Solution: Make the run number global, use in the test to increase the waiting time. (closes vim/vim#5841) https://github.com/vim/vim/commit/3ed9efc2b15b624268bcce4e4d312fb35840a12b Co-authored-by: Bram Moolenaar --- test/old/testdir/test_functions.vim | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index 5981b5214b..ba8134cc2d 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -2568,6 +2568,17 @@ endfunc func Test_state() CheckRunVimInTerminal + " In the first run try a short wait time. If the test fails retry with a + " longer wait time. + if g:run_nr == 1 + let wait_time = 50 + elseif g:run_nr == 2 + let wait_time = 200 + else + let wait_time = 500 + endif + let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\" + let lines =<< trim END call setline(1, ['one', 'two', 'three']) map ;; gg @@ -2587,28 +2598,27 @@ func Test_state() " Using a timer callback call term_sendkeys(buf, ":call RunTimer()\") - call term_wait(buf, 50) - let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\" + call term_wait(buf, wait_time) call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: c; mode: n', term_getline(buf, 6))}, 1000) " Halfway a mapping call term_sendkeys(buf, ":call RunTimer()\;") - call term_wait(buf, 50) + call term_wait(buf, wait_time) call term_sendkeys(buf, ";") call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: mSc; mode: n', term_getline(buf, 6))}, 1000) " Insert mode completion (bit slower on Mac) call term_sendkeys(buf, ":call RunTimer()\Got\") - call term_wait(buf, 200) + call term_wait(buf, wait_time) call term_sendkeys(buf, "\") call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: aSc; mode: i', term_getline(buf, 6))}, 1000) " Autocommand executing call term_sendkeys(buf, ":set filetype=foobar\") - call term_wait(buf, 50) + call term_wait(buf, wait_time) call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: xS; mode: n', term_getline(buf, 6))}, 1000) @@ -2616,7 +2626,7 @@ func Test_state() " messages scrolled call term_sendkeys(buf, ":call RunTimer()\:echo \"one\\ntwo\\nthree\"\") - call term_wait(buf, 50) + call term_wait(buf, wait_time) call term_sendkeys(buf, "\") call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: Scs; mode: r', term_getline(buf, 6))}, 1000) -- cgit From ff801ce7f728ea51cec3328328ac41d98d545725 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 14:59:52 +0800 Subject: vim-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 vim/vim#5899) Halve the initial times to make tests run faster when there is no rerun. https://github.com/vim/vim/commit/6a2c5a7dd5c9215cc030d5ea6e4616d782c091dd Co-authored-by: Bram Moolenaar --- test/old/testdir/test_arglist.vim | 8 ++++---- test/old/testdir/test_autocmd.vim | 6 +++--- test/old/testdir/test_bufline.vim | 2 +- test/old/testdir/test_cmdline.vim | 6 +++--- test/old/testdir/test_cursorline.vim | 32 +++++++++++++++--------------- test/old/testdir/test_debugger.vim | 2 +- test/old/testdir/test_display.vim | 2 +- test/old/testdir/test_functions.vim | 19 +++++------------- test/old/testdir/test_highlight.vim | 12 +++++------ test/old/testdir/test_ins_complete.vim | 6 +++--- test/old/testdir/test_mapping.vim | 4 ++-- test/old/testdir/test_match.vim | 2 +- test/old/testdir/test_matchadd_conceal.vim | 8 ++++---- test/old/testdir/test_messages.vim | 4 ++-- test/old/testdir/test_number.vim | 2 +- test/old/testdir/test_popup.vim | 8 ++++---- test/old/testdir/test_profile.vim | 2 +- test/old/testdir/test_search.vim | 14 ++++++------- test/old/testdir/test_search_stat.vim | 4 ++-- test/old/testdir/test_startup.vim | 4 ++-- test/old/testdir/test_startup_utf8.vim | 2 +- test/old/testdir/test_suspend.vim | 2 +- test/old/testdir/test_swap.vim | 6 +++--- test/old/testdir/test_tagjump.vim | 2 +- test/old/testdir/test_timers.vim | 4 ++-- test/old/testdir/test_vimscript.vim | 12 +++++------ 26 files changed, 83 insertions(+), 92 deletions(-) diff --git a/test/old/testdir/test_arglist.vim b/test/old/testdir/test_arglist.vim index de4e5e33d6..0c381e0ab2 100644 --- a/test/old/testdir/test_arglist.vim +++ b/test/old/testdir/test_arglist.vim @@ -571,7 +571,7 @@ func Test_quit_with_arglist() call term_sendkeys(buf, ":set nomore\n") call term_sendkeys(buf, ":args a b c\n") call term_sendkeys(buf, ":quit\n") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^E173:', term_getline(buf, 6))}) call StopVimInTerminal(buf) @@ -580,16 +580,16 @@ func Test_quit_with_arglist() call term_sendkeys(buf, ":set nomore\n") call term_sendkeys(buf, ":args a b c\n") call term_sendkeys(buf, ":confirm quit\n") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^\[Y\]es, (N)o: *$', \ term_getline(buf, 6))}) call term_sendkeys(buf, "N") - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, ":confirm quit\n") call WaitForAssert({-> assert_match('^\[Y\]es, (N)o: *$', \ term_getline(buf, 6))}) call term_sendkeys(buf, "Y") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))}) only! " When this test fails, swap files are left behind which breaks subsequent diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index fd95988de0..9bb36c4149 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -2984,9 +2984,9 @@ func Test_autocmd_SafeState() call WaitForAssert({-> assert_match('^xxx', term_getline(buf, 6))}, 1000) call term_sendkeys(buf, ":let g:again = ''\:call CallTimer()\") - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, ":\") - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, ":echo g:again\") call WaitForAssert({-> assert_match('xtx', term_getline(buf, 6))}, 1000) @@ -3010,7 +3010,7 @@ func Test_autocmd_CmdWinEnter() let buf = RunVimInTerminal('-S '.filename, #{rows: 6}) call term_sendkeys(buf, "q:") - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, ":echo b:dummy_var\") call WaitForAssert({-> assert_match('^This is a dummy', term_getline(buf, 6))}, 2000) call term_sendkeys(buf, ":echo &buftype\") diff --git a/test/old/testdir/test_bufline.vim b/test/old/testdir/test_bufline.vim index 0468025f55..7431576f6b 100644 --- a/test/old/testdir/test_bufline.vim +++ b/test/old/testdir/test_bufline.vim @@ -217,7 +217,7 @@ func Test_appendbufline_redraw() END call writefile(lines, 'XscriptMatchCommon') let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10}) - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_appendbufline_1', {}) call StopVimInTerminal(buf) diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index aab65eb8fe..a1bfec58d7 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -1482,7 +1482,7 @@ func Test_verbose_option() call writefile(lines, 'XTest_verbose') let buf = RunVimInTerminal('-S XTest_verbose', {'rows': 12}) - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, ":DoSomething\") call VerifyScreenDump(buf, 'Test_verbose_option_1', {}) @@ -1560,7 +1560,7 @@ func Test_cmdwin_restore() call writefile(lines, 'XTest_restore') let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12}) - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, "q:") call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {}) @@ -1687,7 +1687,7 @@ func Test_cmdlineclear_tabenter() call writefile(lines, 'XtestCmdlineClearTabenter') let buf = RunVimInTerminal('-S XtestCmdlineClearTabenter', #{rows: 10}) - call term_wait(buf, 50) + call TermWait(buf, 25) " in one tab make the command line higher with CTRL-W - call term_sendkeys(buf, ":tabnew\\-\-gtgt") call VerifyScreenDump(buf, 'Test_cmdlineclear_tabenter', {}) diff --git a/test/old/testdir/test_cursorline.vim b/test/old/testdir/test_cursorline.vim index 70f39a8601..1284d74032 100644 --- a/test/old/testdir/test_cursorline.vim +++ b/test/old/testdir/test_cursorline.vim @@ -136,41 +136,41 @@ func Test_cursorline_screenline() call writefile(lines, filename) " basic test let buf = RunVimInTerminal('-S '. filename, #{rows: 20}) - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_1', {}) call term_sendkeys(buf, "fagj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_2', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_3', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_4', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_5', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_6', {}) " test with set list and cursorlineopt containing number call term_sendkeys(buf, "gg0") call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\") call VerifyScreenDump(buf, 'Test_'. filename. '_7', {}) call term_sendkeys(buf, "fagj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_8', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_9', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_10', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_11', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_12', {}) if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent") " test with set foldcolumn signcoloumn and breakindent @@ -178,19 +178,19 @@ func Test_cursorline_screenline() call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\") call VerifyScreenDump(buf, 'Test_'. filename. '_13', {}) call term_sendkeys(buf, "fagj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_14', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_15', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_16', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_17', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_18', {}) call term_sendkeys(buf, ":set breakindent& foldcolumn& signcolumn&\") endif diff --git a/test/old/testdir/test_debugger.vim b/test/old/testdir/test_debugger.vim index 18616e8717..ba3f4715ca 100644 --- a/test/old/testdir/test_debugger.vim +++ b/test/old/testdir/test_debugger.vim @@ -36,7 +36,7 @@ endfunc " If the expected output argument is supplied, then check for it. func RunDbgCmd(buf, cmd, ...) call term_sendkeys(a:buf, a:cmd . "\r") - call term_wait(a:buf, 20) + call TermWait(a:buf) if a:0 != 0 let options = #{match: 'equal'} diff --git a/test/old/testdir/test_display.vim b/test/old/testdir/test_display.vim index e007b6f741..4a89b50750 100644 --- a/test/old/testdir/test_display.vim +++ b/test/old/testdir/test_display.vim @@ -177,7 +177,7 @@ func Test_scroll_CursorLineNr_update() call writefile(lines, filename) let buf = RunVimInTerminal('-S '.filename, #{rows: 5, cols: 50}) call term_sendkeys(buf, "k") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_winline_rnu', {}) " clean up diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index ba8134cc2d..95c132a5c0 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -2568,15 +2568,6 @@ endfunc func Test_state() CheckRunVimInTerminal - " In the first run try a short wait time. If the test fails retry with a - " longer wait time. - if g:run_nr == 1 - let wait_time = 50 - elseif g:run_nr == 2 - let wait_time = 200 - else - let wait_time = 500 - endif let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\" let lines =<< trim END @@ -2598,27 +2589,27 @@ func Test_state() " Using a timer callback call term_sendkeys(buf, ":call RunTimer()\") - call term_wait(buf, wait_time) + call TermWait(buf, 25) call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: c; mode: n', term_getline(buf, 6))}, 1000) " Halfway a mapping call term_sendkeys(buf, ":call RunTimer()\;") - call term_wait(buf, wait_time) + call TermWait(buf, 25) call term_sendkeys(buf, ";") call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: mSc; mode: n', term_getline(buf, 6))}, 1000) " Insert mode completion (bit slower on Mac) call term_sendkeys(buf, ":call RunTimer()\Got\") - call term_wait(buf, wait_time) + call TermWait(buf, 25) call term_sendkeys(buf, "\") call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: aSc; mode: i', term_getline(buf, 6))}, 1000) " Autocommand executing call term_sendkeys(buf, ":set filetype=foobar\") - call term_wait(buf, wait_time) + call TermWait(buf, 25) call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: xS; mode: n', term_getline(buf, 6))}, 1000) @@ -2626,7 +2617,7 @@ func Test_state() " messages scrolled call term_sendkeys(buf, ":call RunTimer()\:echo \"one\\ntwo\\nthree\"\") - call term_wait(buf, wait_time) + call TermWait(buf, 25) call term_sendkeys(buf, "\") call term_sendkeys(buf, getstate) call WaitForAssert({-> assert_match('state: Scs; mode: r', term_getline(buf, 6))}, 1000) diff --git a/test/old/testdir/test_highlight.vim b/test/old/testdir/test_highlight.vim index b48c598970..5650d8a32f 100644 --- a/test/old/testdir/test_highlight.vim +++ b/test/old/testdir/test_highlight.vim @@ -543,9 +543,9 @@ func Test_cursorline_after_yank() \ 'call setline(1, ["","1","2","3",""])', \ ], 'Xtest_cursorline_yank') let buf = RunVimInTerminal('-S Xtest_cursorline_yank', {'rows': 8}) - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, "Gy3k") - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, "jj") call VerifyScreenDump(buf, 'Test_cursorline_yank_01', {}) @@ -583,7 +583,7 @@ func Test_cursorline_with_visualmode() \ 'call setline(1, repeat(["abc"], 50))', \ ], 'Xtest_cursorline_with_visualmode') let buf = RunVimInTerminal('-S Xtest_cursorline_with_visualmode', {'rows': 12}) - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, "V\kkkjk") call VerifyScreenDump(buf, 'Test_cursorline_with_visualmode_01', {}) @@ -611,9 +611,9 @@ func Test_wincolor() END call writefile(lines, 'Xtest_wincolor') let buf = RunVimInTerminal('-S Xtest_wincolor', {'rows': 8}) - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, "2G5lvj") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_wincolor_01', {}) @@ -718,7 +718,7 @@ func Test_colorcolumn() call writefile(lines, 'Xtest_colorcolumn') let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10}) call term_sendkeys(buf, ":\") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_colorcolumn_1', {}) " clean up diff --git a/test/old/testdir/test_ins_complete.vim b/test/old/testdir/test_ins_complete.vim index cdc998cad2..f01a95b6fe 100644 --- a/test/old/testdir/test_ins_complete.vim +++ b/test/old/testdir/test_ins_complete.vim @@ -620,7 +620,7 @@ func Test_pum_with_folds_two_tabs() call writefile(lines, 'Xpumscript') let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10}) - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, "a\") call VerifyScreenDump(buf, 'Test_pum_with_folds_two_tabs', {}) @@ -645,9 +645,9 @@ func Test_pum_with_preview_win() call writefile(lines, 'Xpreviewscript') let buf = RunVimInTerminal('-S Xpreviewscript', #{rows: 12}) - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, "Gi\\") - call term_wait(buf, 200) + call TermWait(buf, 100) call term_sendkeys(buf, "\") call VerifyScreenDump(buf, 'Test_pum_with_preview_win', {}) diff --git a/test/old/testdir/test_mapping.vim b/test/old/testdir/test_mapping.vim index f8c8bc95f9..7618ed8547 100644 --- a/test/old/testdir/test_mapping.vim +++ b/test/old/testdir/test_mapping.vim @@ -418,9 +418,9 @@ func Test_error_in_map_expr() " GC must not run during map-expr processing, which can make Vim crash. call term_sendkeys(buf, '!') - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, "\") - call term_wait(buf, 100) + call TermWait(buf, 50) call assert_equal('run', job_status(job)) call term_sendkeys(buf, ":qall!\") diff --git a/test/old/testdir/test_match.vim b/test/old/testdir/test_match.vim index 600b6132a9..300a60fa03 100644 --- a/test/old/testdir/test_match.vim +++ b/test/old/testdir/test_match.vim @@ -322,7 +322,7 @@ func OtherWindowCommon() END call writefile(lines, 'XscriptMatchCommon') let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 12}) - call term_wait(buf) + call TermWait(buf) return buf endfunc diff --git a/test/old/testdir/test_matchadd_conceal.vim b/test/old/testdir/test_matchadd_conceal.vim index 1b5fc8313f..6c9b8786f5 100644 --- a/test/old/testdir/test_matchadd_conceal.vim +++ b/test/old/testdir/test_matchadd_conceal.vim @@ -372,14 +372,14 @@ func Test_cursor_column_in_concealed_line_after_window_scroll() END call writefile(lines, 'Xcolesearch') let buf = RunVimInTerminal('Xcolesearch', {}) - call term_wait(buf, 100) + call TermWait(buf, 50) " Jump to something that is beyond the bottom of the window, " so there's a scroll down. call term_sendkeys(buf, ":so %\") - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, "/expr\") - call term_wait(buf, 100) + call TermWait(buf, 50) " Are the concealed parts of the current line really hidden? let cursor_row = term_scrape(buf, '.')->map({_, e -> e.chars})->join('') @@ -409,7 +409,7 @@ func Test_cursor_column_in_concealed_line_after_leftcol_change() " Horizontal scroll would center the cursor in the screen line, but conceal " makes it go to screen column 1. call term_sendkeys(buf, "$") - call term_wait(buf) + call TermWait(buf) " Are the concealed parts of the current line really hidden? call WaitForAssert({-> assert_equal('c', term_getline(buf, '.'))}) diff --git a/test/old/testdir/test_messages.vim b/test/old/testdir/test_messages.vim index 31c8b9942b..adafb6bd23 100644 --- a/test/old/testdir/test_messages.vim +++ b/test/old/testdir/test_messages.vim @@ -112,7 +112,7 @@ func Test_mode_message_at_leaving_insert_by_ctrl_c() let rows = 10 let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows}) - call term_wait(buf, 200) + call TermWait(buf, 100) call assert_equal('run', job_status(term_getjob(buf))) call term_sendkeys(buf, "i") @@ -140,7 +140,7 @@ func Test_mode_message_at_leaving_insert_with_esc_mapped() let rows = 10 let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows}) - call term_wait(buf, 200) + call WaitForAssert({-> assert_match('0,0-1\s*All$', term_getline(buf, rows - 1))}) call assert_equal('run', job_status(term_getjob(buf))) call term_sendkeys(buf, "i") diff --git a/test/old/testdir/test_number.vim b/test/old/testdir/test_number.vim index cf777fd918..1232db80c5 100644 --- a/test/old/testdir/test_number.vim +++ b/test/old/testdir/test_number.vim @@ -280,7 +280,7 @@ func Test_relativenumber_colors() " Check that the balloon shows up after a mouse move let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50}) - call term_wait(buf, 100) + call TermWait(buf, 50) " Default colors call VerifyScreenDump(buf, 'Test_relnr_colors_1', {}) diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index 54b40e5732..fda84cbae8 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -691,11 +691,11 @@ func Test_popup_and_window_resize() call term_sendkeys(buf, "Gi\") call term_sendkeys(buf, "\") - call term_wait(buf, 100) + call TermWait(buf, 50) " popup first entry "!" must be at the top call WaitForAssert({-> assert_match('^!\s*$', term_getline(buf, 1))}) exe 'resize +' . (h - 1) - call term_wait(buf, 100) + call TermWait(buf, 50) redraw! " popup shifted down, first line is now empty call WaitForAssert({-> assert_equal('', term_getline(buf, 1))}) @@ -759,11 +759,11 @@ func Test_popup_and_previewwindow_dump() let buf = RunVimInTerminal('-S Xscript', {}) " wait for the script to finish - call term_wait(buf) + call TermWait(buf) " Test that popup and previewwindow do not overlap. call term_sendkeys(buf, "o") - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, "\\") call VerifyScreenDump(buf, 'Test_popup_and_previewwindow_01', {}) diff --git a/test/old/testdir/test_profile.vim b/test/old/testdir/test_profile.vim index 9165f7bace..d72060a20e 100644 --- a/test/old/testdir/test_profile.vim +++ b/test/old/testdir/test_profile.vim @@ -584,7 +584,7 @@ func Test_profile_typed_func() \ .. "endfunc\") call term_sendkeys(buf, ":profile func DoSomething\") call term_sendkeys(buf, ":call DoSomething()\") - call term_wait(buf, 200) + call TermWait(buf, 100) call StopVimInTerminal(buf) let lines = readfile('XprofileTypedFunc') call assert_equal("FUNCTION DoSomething()", lines[0]) diff --git a/test/old/testdir/test_search.vim b/test/old/testdir/test_search.vim index c8152af4f3..018ee7ad5a 100644 --- a/test/old/testdir/test_search.vim +++ b/test/old/testdir/test_search.vim @@ -815,12 +815,12 @@ func Test_search_cmdline_incsearch_highlight_attr() 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\") 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 @@ -836,7 +836,7 @@ func Test_search_cmdline_incsearch_highlight_attr() " Test incremental highlight search call term_sendkeys(buf, "/vim") - call term_wait(buf, 200) + call TermWait(buf, 100) " Buffer: " abb vim vim vi " vimvivim @@ -848,7 +848,7 @@ func Test_search_cmdline_incsearch_highlight_attr() " Test call term_sendkeys(buf, "\\") - 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')) @@ -856,7 +856,7 @@ func Test_search_cmdline_incsearch_highlight_attr() " Test call term_sendkeys(buf, "\") - 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')) @@ -864,7 +864,7 @@ func Test_search_cmdline_incsearch_highlight_attr() " Type Enter and a1(incsearch highlight) should become a2(hlsearch highlight) call term_sendkeys(buf, "\") - 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')) @@ -874,7 +874,7 @@ func Test_search_cmdline_incsearch_highlight_attr() call term_sendkeys(buf, ":1\") call term_sendkeys(buf, ":set nohlsearch\") 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')) diff --git a/test/old/testdir/test_search_stat.vim b/test/old/testdir/test_search_stat.vim index e7dc71e302..a41a192c8e 100644 --- a/test/old/testdir/test_search_stat.vim +++ b/test/old/testdir/test_search_stat.vim @@ -364,12 +364,12 @@ func! Test_search_stat_screendump() END call writefile(lines, 'Xsearchstat') let buf = RunVimInTerminal('-S Xsearchstat', #{rows: 10}) - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstat_1', {}) call term_sendkeys(buf, ":nnoremap n n\") call term_sendkeys(buf, "gg0n") - call term_wait(buf) + call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstat_2', {}) call StopVimInTerminal(buf) diff --git a/test/old/testdir/test_startup.vim b/test/old/testdir/test_startup.vim index d2ffbd0e2f..d6711c7ef4 100644 --- a/test/old/testdir/test_startup.vim +++ b/test/old/testdir/test_startup.vim @@ -960,9 +960,9 @@ func Test_missing_vimrc() let cmd = GetVimCommandCleanTerm() . ' -u Xvimrc_missing -S Xafter' let buf = term_start(cmd, {'term_rows' : 10}) call WaitForAssert({-> assert_equal("running", term_getstatus(buf))}) - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, "\n:") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match(':', term_getline(buf, 10))}) call StopVimInTerminal(buf) call assert_equal([], readfile('Xtestout')) diff --git a/test/old/testdir/test_startup_utf8.vim b/test/old/testdir/test_startup_utf8.vim index 2ee6ecc41d..1684d80c80 100644 --- a/test/old/testdir/test_startup_utf8.vim +++ b/test/old/testdir/test_startup_utf8.vim @@ -73,7 +73,7 @@ func Test_detect_ambiwidth() \ 'redraw', \ ], 'Xscript') let buf = RunVimInTerminal('-S Xscript', #{keep_t_u7: 1}) - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, "S\=&ambiwidth\\") call WaitForAssert({-> assert_match('single', term_getline(buf, 1))}) diff --git a/test/old/testdir/test_suspend.vim b/test/old/testdir/test_suspend.vim index bf88bd4453..aa6603be78 100644 --- a/test/old/testdir/test_suspend.vim +++ b/test/old/testdir/test_suspend.vim @@ -53,7 +53,7 @@ func Test_suspend() " Quit gracefully to dump coverage information. call term_sendkeys(buf, ":qall!\") - call term_wait(buf) + call TermWait(buf) " Wait until Vim actually exited and shell shows a prompt call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))}) call StopShellInTerminal(buf) diff --git a/test/old/testdir/test_swap.vim b/test/old/testdir/test_swap.vim index fac1893e4c..65b6c57850 100644 --- a/test/old/testdir/test_swap.vim +++ b/test/old/testdir/test_swap.vim @@ -374,14 +374,14 @@ func Test_swap_prompt_splitwin() call term_sendkeys(buf, ":set noruler\n") call term_sendkeys(buf, ":split Xfile1\n") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^\[O\]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort: $', term_getline(buf, 20))}) call term_sendkeys(buf, "q") - call term_wait(buf) + call TermWait(buf) call term_sendkeys(buf, ":\") call WaitForAssert({-> assert_match('^:$', term_getline(buf, 20))}) call term_sendkeys(buf, ":echomsg winnr('$')\") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^1$', term_getline(buf, 20))}) call StopVimInTerminal(buf) diff --git a/test/old/testdir/test_tagjump.vim b/test/old/testdir/test_tagjump.vim index f330bca125..2ef5bd720b 100644 --- a/test/old/testdir/test_tagjump.vim +++ b/test/old/testdir/test_tagjump.vim @@ -671,7 +671,7 @@ func Test_tselect() call writefile(lines, 'XTest_tselect') let buf = RunVimInTerminal('-S XTest_tselect', {'rows': 10, 'cols': 50}) - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, ":tselect main\2\") call VerifyScreenDump(buf, 'Test_tselect_1', {}) diff --git a/test/old/testdir/test_timers.vim b/test/old/testdir/test_timers.vim index 37226c7efb..21541d673d 100644 --- a/test/old/testdir/test_timers.vim +++ b/test/old/testdir/test_timers.vim @@ -386,9 +386,9 @@ func Test_timer_error_in_timer_callback() call WaitForAssert({-> assert_notequal('', term_getline(buf, 8))}) " GC must not run during timer callback, which can make Vim crash. - call term_wait(buf, 100) + call TermWait(buf, 50) call term_sendkeys(buf, "\") - call term_wait(buf, 100) + call TermWait(buf, 50) call assert_equal('run', job_status(job)) call term_sendkeys(buf, ":qall!\") diff --git a/test/old/testdir/test_vimscript.vim b/test/old/testdir/test_vimscript.vim index 62487ae5d5..1072199f27 100644 --- a/test/old/testdir/test_vimscript.vim +++ b/test/old/testdir/test_vimscript.vim @@ -7249,30 +7249,30 @@ func Test_deep_nest() " Deep nesting of if ... endif call term_sendkeys(buf, ":call Test1()\n") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^E579:', term_getline(buf, 5))}) " Deep nesting of for ... endfor call term_sendkeys(buf, ":call Test2()\n") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^E585:', term_getline(buf, 5))}) " Deep nesting of while ... endwhile call term_sendkeys(buf, ":call Test3()\n") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^E585:', term_getline(buf, 5))}) " Deep nesting of try ... endtry call term_sendkeys(buf, ":call Test4()\n") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^E601:', term_getline(buf, 5))}) " Deep nesting of function ... endfunction call term_sendkeys(buf, ":call Test5()\n") - call term_wait(buf) + call TermWait(buf) call WaitForAssert({-> assert_match('^E1058:', term_getline(buf, 4))}) call term_sendkeys(buf, "\\n") - call term_wait(buf) + call TermWait(buf) "let l = '' "for i in range(1, 6) -- cgit From d4b6a25e675639f799aa87213e247816d4279594 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 15:27:51 +0800 Subject: vim-patch:8.2.2908: crash when using a terminal popup window from cmdline window Problem: Crash when using a terminal popup window from the cmdline window. Solution: Instead of checking cmdwin_type call cmdwin_is_active(). (closes vim/vim#8286) https://github.com/vim/vim/commit/e5b4486c4279a9674a9bb76130b4db53fb9303a0 Co-authored-by: Bram Moolenaar --- test/old/testdir/test_cmdline.vim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index a1bfec58d7..a039ab95ca 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -1580,6 +1580,20 @@ func Test_cmdwin_restore() call delete('XTest_restore') endfunc +func Test_cmdwin_no_terminal() + CheckFeature cmdwin + CheckFeature terminal + + let buf = RunVimInTerminal('', {'rows': 12}) + call TermWait(buf, 50) + call term_sendkeys(buf, ":set cmdheight=2\") + call term_sendkeys(buf, "q:") + call term_sendkeys(buf, ":let buf = term_start(['/bin/echo'], #{hidden: 1})\") + call VerifyScreenDump(buf, 'Test_cmdwin_no_terminal', {}) + call term_sendkeys(buf, ":q\") + call StopVimInTerminal(buf) +endfunc + func Test_buffers_lastused() " check that buffers are sorted by time when wildmode has lastused edit bufc " oldest -- cgit From 7aa3f825cd4298276186493fc45ff739049a95a2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 15:28:43 +0800 Subject: vim-patch:8.2.2910: test for cmdline window and terminal fails on MS-Windows Problem: Test for cmdline window and terminal fails on MS-Windows. Solution: Skip the test on MS-Windows. https://github.com/vim/vim/commit/0b49648486c5857047433c11d0871f79b53613a5 Co-authored-by: Bram Moolenaar --- test/old/testdir/test_cmdline.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim index a039ab95ca..a85c8229af 100644 --- a/test/old/testdir/test_cmdline.vim +++ b/test/old/testdir/test_cmdline.vim @@ -1583,6 +1583,7 @@ endfunc func Test_cmdwin_no_terminal() CheckFeature cmdwin CheckFeature terminal + CheckNotMSWindows let buf = RunVimInTerminal('', {'rows': 12}) call TermWait(buf, 50) -- cgit From 00f92f086e9e4b47e7067b8247881491468eb893 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 15:30:20 +0800 Subject: vim-patch:8.2.3518: Test_xrestore sometimes fails Problem: Test_xrestore sometimes fails. Solution: Mark the test as flayky. Move marking test as flaky to the test instead of listing them in runtest. https://github.com/vim/vim/commit/f08b0eb8691ff09f98bc4beef986ece1c521655f Co-authored-by: Bram Moolenaar --- test/old/testdir/runtest.vim | 30 +----------------------------- test/old/testdir/test_autocmd.vim | 3 +++ test/old/testdir/test_clientserver.vim | 3 ++- test/old/testdir/test_diffmode.vim | 1 + test/old/testdir/test_functions.vim | 1 + test/old/testdir/test_mapping.vim | 8 ++++---- test/old/testdir/test_popup.vim | 2 ++ test/old/testdir/test_quotestar.vim | 1 + test/old/testdir/test_reltime.vim | 1 + test/old/testdir/test_timers.vim | 7 +++++++ 10 files changed, 23 insertions(+), 34 deletions(-) diff --git a/test/old/testdir/runtest.vim b/test/old/testdir/runtest.vim index 08dde1fe4f..6be6fd0fd3 100644 --- a/test/old/testdir/runtest.vim +++ b/test/old/testdir/runtest.vim @@ -489,33 +489,6 @@ else endtry endif -" Names of flaky tests. -let s:flaky_tests = [ - \ 'Test_autocmd_SafeState()', - \ 'Test_cursorhold_insert()', - \ 'Test_exit_callback_interval()', - \ 'Test_map_timeout_with_timer_interrupt()', - \ 'Test_out_cb()', - \ 'Test_popup_and_window_resize()', - \ 'Test_quoteplus()', - \ 'Test_quotestar()', - \ 'Test_reltime()', - \ 'Test_state()', - \ 'Test_term_mouse_double_click_to_create_tab()', - \ 'Test_term_mouse_multiple_clicks_to_visually_select()', - \ 'Test_terminal_composing_unicode()', - \ 'Test_terminal_redir_file()', - \ 'Test_terminal_tmap()', - \ 'Test_timer_oneshot()', - \ 'Test_timer_paused()', - \ 'Test_timer_repeat_many()', - \ 'Test_timer_repeat_three()', - \ 'Test_timer_stop_all_in_callback()', - \ 'Test_timer_stop_in_callback()', - \ 'Test_timer_with_partial_callback()', - \ 'Test_termwinscroll()', - \ ] - " Delete the .res file, it may change behavior for completion call delete(fnamemodify(g:testname, ':r') .. '.res') @@ -565,8 +538,7 @@ for g:testfunc in sort(s:tests) " - it fails five times (with a different message) if len(v:errors) > 0 \ && $TEST_NO_RETRY == '' - \ && (index(s:flaky_tests, g:testfunc) >= 0 - \ || g:test_is_flaky) + \ && g:test_is_flaky while 1 call add(s:messages, 'Found errors in ' .. g:testfunc .. ':') call extend(s:messages, v:errors) diff --git a/test/old/testdir/test_autocmd.vim b/test/old/testdir/test_autocmd.vim index 9bb36c4149..59149abaf7 100644 --- a/test/old/testdir/test_autocmd.vim +++ b/test/old/testdir/test_autocmd.vim @@ -2013,6 +2013,7 @@ endfunc " Test for BufUnload autocommand that unloads all the other buffers func Test_bufunload_all() + let g:test_is_flaky = 1 call writefile(['Test file Xxx1'], 'Xxx1')" call writefile(['Test file Xxx2'], 'Xxx2')" @@ -2961,6 +2962,7 @@ endfunc func Test_autocmd_SafeState() CheckRunVimInTerminal + let g:test_is_flaky = 1 let lines =<< trim END let g:safe = 0 @@ -3044,6 +3046,7 @@ func Test_autocmd_was_using_freed_memory() endfunc func Test_BufWrite_lockmarks() + let g:test_is_flaky = 1 edit! Xtest call setline(1, ['a', 'b', 'c', 'd']) diff --git a/test/old/testdir/test_clientserver.vim b/test/old/testdir/test_clientserver.vim index d8b29f6c42..be6c8151af 100644 --- a/test/old/testdir/test_clientserver.vim +++ b/test/old/testdir/test_clientserver.vim @@ -26,9 +26,10 @@ func Check_X11_Connection() endfunc func Test_client_server() + let g:test_is_flaky = 1 let cmd = GetVimCommand() if cmd == '' - return + throw 'GetVimCommand() failed' endif call Check_X11_Connection() diff --git a/test/old/testdir/test_diffmode.vim b/test/old/testdir/test_diffmode.vim index ac90aaaa02..bc5c42e985 100644 --- a/test/old/testdir/test_diffmode.vim +++ b/test/old/testdir/test_diffmode.vim @@ -857,6 +857,7 @@ func VerifyInternal(buf, dumpfile, extra) endfunc func Test_diff_screen() + let g:test_is_flaky = 1 CheckScreendump CheckFeature menu diff --git a/test/old/testdir/test_functions.vim b/test/old/testdir/test_functions.vim index 95c132a5c0..1d713e91ce 100644 --- a/test/old/testdir/test_functions.vim +++ b/test/old/testdir/test_functions.vim @@ -2567,6 +2567,7 @@ endfunc func Test_state() CheckRunVimInTerminal + let g:test_is_flaky = 1 let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\" diff --git a/test/old/testdir/test_mapping.vim b/test/old/testdir/test_mapping.vim index 7618ed8547..40d0b3e6f7 100644 --- a/test/old/testdir/test_mapping.vim +++ b/test/old/testdir/test_mapping.vim @@ -278,9 +278,9 @@ func Test_map_timeout() endfunc func Test_map_timeout_with_timer_interrupt() - if !has('job') || !has('timers') - return - endif + CheckFeature job + CheckFeature timers + let g:test_is_flaky = 1 " Confirm the timer invoked in exit_cb of the job doesn't disturb mapped key " sequence. @@ -1226,7 +1226,7 @@ func Test_map_cmdkey_visual_mode() call feedkeys("v\", 'xt!') call assert_equal(['v', 1, 12], [mode(1), col('v'), col('.')]) - " can invoke an opeartor, ending the visual mode + " can invoke an operator, ending the visual mode let @a = '' call feedkeys("\", 'xt!') call assert_equal('n', mode(1)) diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index fda84cbae8..82408b508b 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -676,7 +676,9 @@ endfunc func Test_popup_and_window_resize() CheckFeature terminal + CheckFeature quickfix CheckNotGui + let g:test_is_flaky = 1 let h = winheight(0) if h < 15 diff --git a/test/old/testdir/test_quotestar.vim b/test/old/testdir/test_quotestar.vim index 6a6719da8b..93b0d928ce 100644 --- a/test/old/testdir/test_quotestar.vim +++ b/test/old/testdir/test_quotestar.vim @@ -131,6 +131,7 @@ func Do_test_quotestar_for_x11() endfunc func Test_quotestar() + let g:test_is_flaky = 1 let skipped = '' let quotestar_saved = @* diff --git a/test/old/testdir/test_reltime.vim b/test/old/testdir/test_reltime.vim index f4ce5de118..8ed09dd10f 100644 --- a/test/old/testdir/test_reltime.vim +++ b/test/old/testdir/test_reltime.vim @@ -5,6 +5,7 @@ CheckFeature reltime CheckFeature float func Test_reltime() + let g:test_is_flaky = 1 let now = reltime() sleep 10m let later = reltime() diff --git a/test/old/testdir/test_timers.vim b/test/old/testdir/test_timers.vim index 21541d673d..42114618fb 100644 --- a/test/old/testdir/test_timers.vim +++ b/test/old/testdir/test_timers.vim @@ -21,6 +21,7 @@ func MyHandlerWithLists(lists, timer) endfunc func Test_timer_oneshot() + let g:test_is_flaky = 1 let g:val = 0 let timer = timer_start(50, 'MyHandler') let slept = WaitFor('g:val == 1') @@ -33,6 +34,7 @@ func Test_timer_oneshot() endfunc func Test_timer_repeat_three() + let g:test_is_flaky = 1 let g:val = 0 let timer = timer_start(50, 'MyHandler', {'repeat': 3}) let slept = WaitFor('g:val == 3') @@ -45,6 +47,7 @@ func Test_timer_repeat_three() endfunc func Test_timer_repeat_many() + let g:test_is_flaky = 1 let g:val = 0 let timer = timer_start(50, 'MyHandler', {'repeat': -1}) sleep 200m @@ -53,6 +56,7 @@ func Test_timer_repeat_many() endfunc func Test_timer_with_partial_callback() + let g:test_is_flaky = 1 let g:val = 0 let meow = {'one': 1} function meow.bite(...) @@ -114,6 +118,7 @@ func Test_timer_stopall() endfunc func Test_timer_paused() + let g:test_is_flaky = 1 let g:val = 0 let id = timer_start(50, 'MyHandler') @@ -168,6 +173,7 @@ func StopTimer2(timer) endfunc func Test_timer_stop_in_callback() + let g:test_is_flaky = 1 call assert_equal(0, len(timer_info())) let g:timer1 = timer_start(10, 'StopTimer1') let slept = 0 @@ -187,6 +193,7 @@ func StopTimerAll(timer) endfunc func Test_timer_stop_all_in_callback() + let g:test_is_flaky = 1 call assert_equal(0, len(timer_info())) call timer_start(10, 'StopTimerAll') call assert_equal(1, len(timer_info())) -- cgit From 02ca31979bed2b7e432401b23aaf7987a3f0badb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 21 Aug 2023 15:38:19 +0800 Subject: vim-patch:8.2.4339: CTRL-A does not work properly with the cmdline popup menu Problem: CTRL-A does not work properly with the cmdline popup menu. Solution: Fix issues with CTRL-A. Add more tests for the cmdline popup menu. Remove TermWait() before VeriryScreenDump(). Refactor the cmdline popup code. (Yegappan Lakshmanan, closes vim/vim#9735) https://github.com/vim/vim/commit/560dff49c0095111fc96b4b8dd7f4d269aba9473 Co-authored-by: Yegappan Lakshmanan --- test/old/testdir/test_bufline.vim | 1 - test/old/testdir/test_cursorline.vim | 21 --------------------- test/old/testdir/test_diffmode.vim | 1 - test/old/testdir/test_display.vim | 1 - test/old/testdir/test_highlight.vim | 2 -- test/old/testdir/test_match.vim | 3 --- test/old/testdir/test_popup.vim | 3 --- test/old/testdir/test_search_stat.vim | 7 ------- 8 files changed, 39 deletions(-) diff --git a/test/old/testdir/test_bufline.vim b/test/old/testdir/test_bufline.vim index 7431576f6b..50feaf2689 100644 --- a/test/old/testdir/test_bufline.vim +++ b/test/old/testdir/test_bufline.vim @@ -217,7 +217,6 @@ func Test_appendbufline_redraw() END call writefile(lines, 'XscriptMatchCommon') let buf = RunVimInTerminal('-S XscriptMatchCommon', #{rows: 10}) - call TermWait(buf) call VerifyScreenDump(buf, 'Test_appendbufline_1', {}) call StopVimInTerminal(buf) diff --git a/test/old/testdir/test_cursorline.vim b/test/old/testdir/test_cursorline.vim index 1284d74032..294c97e2cb 100644 --- a/test/old/testdir/test_cursorline.vim +++ b/test/old/testdir/test_cursorline.vim @@ -136,41 +136,30 @@ func Test_cursorline_screenline() call writefile(lines, filename) " basic test let buf = RunVimInTerminal('-S '. filename, #{rows: 20}) - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_1', {}) call term_sendkeys(buf, "fagj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_2', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_3', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_4', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_5', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_6', {}) " test with set list and cursorlineopt containing number call term_sendkeys(buf, "gg0") call term_sendkeys(buf, ":set list cursorlineopt+=number listchars=space:-\") call VerifyScreenDump(buf, 'Test_'. filename. '_7', {}) call term_sendkeys(buf, "fagj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_8', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_9', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_10', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_11', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_12', {}) if exists("+foldcolumn") && exists("+signcolumn") && exists("+breakindent") " test with set foldcolumn signcoloumn and breakindent @@ -178,19 +167,14 @@ func Test_cursorline_screenline() call term_sendkeys(buf, ":set breakindent foldcolumn=2 signcolumn=yes\") call VerifyScreenDump(buf, 'Test_'. filename. '_13', {}) call term_sendkeys(buf, "fagj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_14', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_15', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_16', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_17', {}) call term_sendkeys(buf, "gj") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_18', {}) call term_sendkeys(buf, ":set breakindent& foldcolumn& signcolumn&\") endif @@ -200,19 +184,14 @@ func Test_cursorline_screenline() call term_sendkeys(buf, ":set nonumber\") call VerifyScreenDump(buf, 'Test_'. filename. '_19', {}) call term_sendkeys(buf, "fagj") - call term_wait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_20', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_21', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_22', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_23', {}) call term_sendkeys(buf, "gj") - call term_wait(buf) call VerifyScreenDump(buf, 'Test_'. filename. '_24', {}) call term_sendkeys(buf, ":set list& cursorlineopt& listchars&\") diff --git a/test/old/testdir/test_diffmode.vim b/test/old/testdir/test_diffmode.vim index bc5c42e985..d6d9f351fc 100644 --- a/test/old/testdir/test_diffmode.vim +++ b/test/old/testdir/test_diffmode.vim @@ -852,7 +852,6 @@ func VerifyInternal(buf, dumpfile, extra) call term_sendkeys(a:buf, ":diffupdate!\") " trailing : for leaving the cursor on the command line call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\:") - call TermWait(a:buf) call VerifyScreenDump(a:buf, a:dumpfile, {}) endfunc diff --git a/test/old/testdir/test_display.vim b/test/old/testdir/test_display.vim index 4a89b50750..b08d093a2a 100644 --- a/test/old/testdir/test_display.vim +++ b/test/old/testdir/test_display.vim @@ -177,7 +177,6 @@ func Test_scroll_CursorLineNr_update() call writefile(lines, filename) let buf = RunVimInTerminal('-S '.filename, #{rows: 5, cols: 50}) call term_sendkeys(buf, "k") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_winline_rnu', {}) " clean up diff --git a/test/old/testdir/test_highlight.vim b/test/old/testdir/test_highlight.vim index 5650d8a32f..a83dc34063 100644 --- a/test/old/testdir/test_highlight.vim +++ b/test/old/testdir/test_highlight.vim @@ -718,7 +718,6 @@ func Test_colorcolumn() call writefile(lines, 'Xtest_colorcolumn') let buf = RunVimInTerminal('-S Xtest_colorcolumn', {'rows': 10}) call term_sendkeys(buf, ":\") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_colorcolumn_1', {}) " clean up @@ -736,7 +735,6 @@ func Test_colorcolumn_bri() call writefile(lines, 'Xtest_colorcolumn_bri') let buf = RunVimInTerminal('-S Xtest_colorcolumn_bri', {'rows': 10,'columns': 40}) call term_sendkeys(buf, ":set co=40 linebreak bri briopt=shift:2 cc=40,41,43\") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_colorcolumn_2', {}) " clean up diff --git a/test/old/testdir/test_match.vim b/test/old/testdir/test_match.vim index 300a60fa03..1cb52b8b2a 100644 --- a/test/old/testdir/test_match.vim +++ b/test/old/testdir/test_match.vim @@ -373,7 +373,6 @@ func Test_match_in_linebreak() END call writefile(lines, 'XscriptMatchLinebreak') let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10}) - call TermWait(buf) call VerifyScreenDump(buf, 'Test_match_linebreak', {}) call StopVimInTerminal(buf) @@ -390,7 +389,6 @@ func Test_match_with_incsearch() END call writefile(lines, 'XmatchWithIncsearch') let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6}) - call TermWait(buf) call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {}) call term_sendkeys(buf, ":s/0") @@ -431,7 +429,6 @@ func Test_match_tab_with_linebreak() END call writefile(lines, 'XscriptMatchTabLinebreak') let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10}) - call TermWait(buf) call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {}) call StopVimInTerminal(buf) diff --git a/test/old/testdir/test_popup.vim b/test/old/testdir/test_popup.vim index 82408b508b..0ff7d67c9f 100644 --- a/test/old/testdir/test_popup.vim +++ b/test/old/testdir/test_popup.vim @@ -1210,7 +1210,6 @@ func Test_pum_rightleft() let buf = RunVimInTerminal('--cmd "set rightleft" Xtest1', {}) call term_wait(buf) call term_sendkeys(buf, "Go\") - call term_wait(buf) call VerifyScreenDump(buf, 'Test_pum_rightleft_01', {'rows': 8}) call term_sendkeys(buf, "\\") call term_wait(buf) @@ -1252,7 +1251,6 @@ func Test_pum_scrollbar() let buf = RunVimInTerminal('--cmd "set pumheight=2" Xtest1', {}) call term_wait(buf) call term_sendkeys(buf, "Go\\\") - call term_wait(buf) call VerifyScreenDump(buf, 'Test_pum_scrollbar_01', {'rows': 7}) call term_sendkeys(buf, "\\dd") call term_wait(buf) @@ -1261,7 +1259,6 @@ func Test_pum_scrollbar() call term_sendkeys(buf, ":set rightleft\") call term_wait(buf) call term_sendkeys(buf, "Go\\\") - call term_wait(buf) call VerifyScreenDump(buf, 'Test_pum_scrollbar_02', {'rows': 7}) endif diff --git a/test/old/testdir/test_search_stat.vim b/test/old/testdir/test_search_stat.vim index a41a192c8e..a2523fc6c7 100644 --- a/test/old/testdir/test_search_stat.vim +++ b/test/old/testdir/test_search_stat.vim @@ -333,15 +333,12 @@ func Test_search_stat_foldopen() call writefile(lines, 'Xsearchstat1') let buf = RunVimInTerminal('-S Xsearchstat1', #{rows: 10}) - call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstat_3', {}) call term_sendkeys(buf, "n") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstat_3', {}) call term_sendkeys(buf, "n") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstat_3', {}) call StopVimInTerminal(buf) @@ -364,12 +361,10 @@ func! Test_search_stat_screendump() END call writefile(lines, 'Xsearchstat') let buf = RunVimInTerminal('-S Xsearchstat', #{rows: 10}) - call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstat_1', {}) call term_sendkeys(buf, ":nnoremap n n\") call term_sendkeys(buf, "gg0n") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstat_2', {}) call StopVimInTerminal(buf) @@ -388,11 +383,9 @@ func Test_search_stat_then_gd() let buf = RunVimInTerminal('-S Xsearchstatgd', #{rows: 10}) call term_sendkeys(buf, "/dog\") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstatgd_1', {}) call term_sendkeys(buf, "G0gD") - call TermWait(buf) call VerifyScreenDump(buf, 'Test_searchstatgd_2', {}) call StopVimInTerminal(buf) -- cgit