From f706d24045b5243386460119bbf7c1caa2c5cc37 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 30 Nov 2022 09:47:30 +0800 Subject: vim-patch:8.2.5082: retab test fails Problem: Retab test fails. Solution: Disable the test for now. https://github.com/vim/vim/commit/93974239857318fe604e53abd41ffead04b7c657 Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_retab.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_retab.vim b/src/nvim/testdir/test_retab.vim index 1650a03876..c08c226937 100644 --- a/src/nvim/testdir/test_retab.vim +++ b/src/nvim/testdir/test_retab.vim @@ -81,7 +81,8 @@ func Test_retab_error() call assert_fails('ret 80000000000000000000', 'E475:') endfunc -func Test_retab_endless() +" FIXME: the try/catch does not catch the interrupt +func FIXME_Test_retab_endless() new call setline(1, "\t0\t") let caught = 'no' @@ -90,9 +91,10 @@ func Test_retab_endless() set ts=4000 retab 4 endwhile - catch /E1240/ - let caught = 'yes' + catch + let caught = v:exception endtry + call assert_notequal('no', caught) bwipe! set tabstop& endfunc -- cgit From a7dc48f19dcd6341cf5e9e199b3ad30e1b9f7327 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 30 Nov 2022 09:48:10 +0800 Subject: vim-patch:8.2.5102: interrupt not caught in test Problem: Interrupt not caught in test. Solution: Consider an exception thrown in the current try/catch when got_int is set. Also catch early exit when not using try/catch. https://github.com/vim/vim/commit/8bea171f154845046239c61bdef50a8e0f12f643 Cherry-pick test changes from patch 8.2.0557. https://github.com/vim/vim/commit/bfe13ccc58ccb96f243a58309800410db1ccb52c Co-authored-by: Bram Moolenaar --- src/nvim/testdir/runtest.vim | 23 +++++++++++------------ src/nvim/testdir/test_escaped_glob.vim | 2 +- src/nvim/testdir/test_getcwd.vim | 2 +- src/nvim/testdir/test_hide.vim | 2 +- src/nvim/testdir/test_retab.vim | 30 ++++++++++++++++++++++-------- 5 files changed, 36 insertions(+), 23 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/runtest.vim b/src/nvim/testdir/runtest.vim index a1b04a4601..15f66fc1ad 100644 --- a/src/nvim/testdir/runtest.vim +++ b/src/nvim/testdir/runtest.vim @@ -171,6 +171,7 @@ func RunTheTest(test) endtry endif + au VimLeavePre * call EarlyExit(g:testfunc) if a:test =~ 'Test_nocatch_' " Function handles errors itself. This avoids skipping commands after the " error. @@ -182,10 +183,7 @@ func RunTheTest(test) endif else try - let s:test = a:test - au VimLeavePre * call EarlyExit(s:test) exe 'call ' . a:test - au! VimLeavePre catch /^\cskipped/ call add(s:messages, ' Skipped') call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', '')) @@ -193,6 +191,7 @@ func RunTheTest(test) call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) endtry endif + au! VimLeavePre " In case 'insertmode' was set and something went wrong, make sure it is " reset to avoid trouble with anything else. @@ -255,11 +254,11 @@ func AfterTheTest(func_name) if len(v:errors) > 0 if match(s:may_fail_list, '^' .. a:func_name) >= 0 let s:fail_expected += 1 - call add(s:errors_expected, 'Found errors in ' . s:test . ':') + call add(s:errors_expected, 'Found errors in ' . g:testfunc . ':') call extend(s:errors_expected, v:errors) else let s:fail += 1 - call add(s:errors, 'Found errors in ' . s:test . ':') + call add(s:errors, 'Found errors in ' . g:testfunc . ':') call extend(s:errors, v:errors) endif let v:errors = [] @@ -420,12 +419,12 @@ endif let s:may_fail_list = [] if $TEST_MAY_FAIL != '' - " Split the list at commas and add () to make it match s:test. + " Split the list at commas and add () to make it match g:testfunc. let s:may_fail_list = split($TEST_MAY_FAIL, ',')->map({i, v -> v .. '()'}) endif " Execute the tests in alphabetical order. -for s:test in sort(s:tests) +for g:testfunc in sort(s:tests) " Silence, please! set belloff=all let prev_error = '' @@ -435,7 +434,7 @@ for s:test in sort(s:tests) " A test can set g:test_is_flaky to retry running the test. let g:test_is_flaky = 0 - call RunTheTest(s:test) + call RunTheTest(g:testfunc) " Repeat a flaky test. Give up when: " - $TEST_NO_RETRY is not empty @@ -443,10 +442,10 @@ for s:test in sort(s:tests) " - it fails five times (with a different message) if len(v:errors) > 0 \ && $TEST_NO_RETRY == '' - \ && (index(s:flaky_tests, s:test) >= 0 + \ && (index(s:flaky_tests, g:testfunc) >= 0 \ || g:test_is_flaky) while 1 - call add(s:messages, 'Found errors in ' . s:test . ':') + call add(s:messages, 'Found errors in ' . g:testfunc . ':') call extend(s:messages, v:errors) call add(total_errors, 'Run ' . g:run_nr . ':') @@ -469,7 +468,7 @@ for s:test in sort(s:tests) let v:errors = [] let g:run_nr += 1 - call RunTheTest(s:test) + call RunTheTest(g:testfunc) if len(v:errors) == 0 " Test passed on rerun. @@ -478,7 +477,7 @@ for s:test in sort(s:tests) endwhile endif - call AfterTheTest(s:test) + call AfterTheTest(g:testfunc) endfor call FinishTesting() diff --git a/src/nvim/testdir/test_escaped_glob.vim b/src/nvim/testdir/test_escaped_glob.vim index 1a4fd8bdab..9f53c76a2c 100644 --- a/src/nvim/testdir/test_escaped_glob.vim +++ b/src/nvim/testdir/test_escaped_glob.vim @@ -1,7 +1,7 @@ " Test whether glob()/globpath() return correct results with certain escaped " characters. -function SetUp() +func SetUp() " consistent sorting of file names set nofileignorecase endfunction diff --git a/src/nvim/testdir/test_getcwd.vim b/src/nvim/testdir/test_getcwd.vim index a75583cd2c..073f8303dc 100644 --- a/src/nvim/testdir/test_getcwd.vim +++ b/src/nvim/testdir/test_getcwd.vim @@ -24,7 +24,7 @@ endfunc " Do all test in a separate window to avoid E211 when we recursively " delete the Xtopdir directory during cleanup -function SetUp() +func SetUp() set visualbell set nocp viminfo+=nviminfo diff --git a/src/nvim/testdir/test_hide.vim b/src/nvim/testdir/test_hide.vim index 41b1a4ad7c..b3ce395523 100644 --- a/src/nvim/testdir/test_hide.vim +++ b/src/nvim/testdir/test_hide.vim @@ -1,6 +1,6 @@ " Tests for :hide command/modifier and 'hidden' option -function SetUp() +func SetUp() let s:save_hidden = &hidden let s:save_bufhidden = &bufhidden let s:save_autowrite = &autowrite diff --git a/src/nvim/testdir/test_retab.vim b/src/nvim/testdir/test_retab.vim index c08c226937..a50f35ed7e 100644 --- a/src/nvim/testdir/test_retab.vim +++ b/src/nvim/testdir/test_retab.vim @@ -81,20 +81,34 @@ func Test_retab_error() call assert_fails('ret 80000000000000000000', 'E475:') endfunc -" FIXME: the try/catch does not catch the interrupt -func FIXME_Test_retab_endless() +func RetabLoop() + while 1 + set ts=4000 + retab 4 + endwhile +endfunc + +func Test_retab_endless() + " inside try/catch we catch the error message new call setline(1, "\t0\t") let caught = 'no' try - while 1 - set ts=4000 - retab 4 - endwhile - catch + call RetabLoop() + catch /E1240:/ let caught = v:exception endtry - call assert_notequal('no', caught) + call assert_match('E1240:', caught) + bwipe! + set tabstop& +endfunc + +func Test_nocatch_retab_endless() + " not inside try/catch an interrupt is generated to get out of loops + new + call setline(1, "\t0\t") + call assert_fails('call RetabLoop()', ['E1240:', 'Interrupted']) + bwipe! set tabstop& endfunc -- cgit From c180e0d8d578b41739a8cce588ef1b4fa26de560 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 30 Nov 2022 10:04:07 +0800 Subject: vim-patch:8.2.5103: build fails with small features Problem: Build fails with small features. Solution: Add #ifdef. Skip test on MS-Windows. https://github.com/vim/vim/commit/34f99584c73f91bcc8ca5236557a2a09335e1e43 Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_retab.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_retab.vim b/src/nvim/testdir/test_retab.vim index a50f35ed7e..bbca89432a 100644 --- a/src/nvim/testdir/test_retab.vim +++ b/src/nvim/testdir/test_retab.vim @@ -104,6 +104,9 @@ func Test_retab_endless() endfunc func Test_nocatch_retab_endless() + " FIXME: why does this hang on MS-Windows? + CheckNotMSWindows + " not inside try/catch an interrupt is generated to get out of loops new call setline(1, "\t0\t") -- cgit From b57daafdd9ece4d5e8412f080c01b8fa82774985 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 30 Nov 2022 10:04:50 +0800 Subject: vim-patch:8.2.5104: test hangs on MS-Windows Problem: Test hangs on MS-Windows. Solution: Skip another test on MS-Windows. https://github.com/vim/vim/commit/b31cb04771234556374cda45ce19dabd4a2a7fc7 Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_retab.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_retab.vim b/src/nvim/testdir/test_retab.vim index bbca89432a..3bd8a9928c 100644 --- a/src/nvim/testdir/test_retab.vim +++ b/src/nvim/testdir/test_retab.vim @@ -1,4 +1,7 @@ " Test :retab + +source check.vim + func SetUp() new call setline(1, "\ta \t b c ") @@ -89,6 +92,9 @@ func RetabLoop() endfunc func Test_retab_endless() + " FIXME: why does this hang on MS-Windows? + CheckNotMSWindows + " inside try/catch we catch the error message new call setline(1, "\t0\t") @@ -104,7 +110,7 @@ func Test_retab_endless() endfunc func Test_nocatch_retab_endless() - " FIXME: why does this hang on MS-Windows? + " FIXME: does this hang on MS-Windows? CheckNotMSWindows " not inside try/catch an interrupt is generated to get out of loops -- cgit From 3f743c39d3be332eede7fe7a4f6641dd9348b922 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 30 Nov 2022 10:07:04 +0800 Subject: vim-patch:8.2.5105: test still hangs on MS-Windows Problem: Test still hangs on MS-Windows. Solution: Skip "nocatch" test the right way. https://github.com/vim/vim/commit/83497f875881973df772cc4cc593766345df6c4a Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_retab.vim | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_retab.vim b/src/nvim/testdir/test_retab.vim index 3bd8a9928c..4253e77487 100644 --- a/src/nvim/testdir/test_retab.vim +++ b/src/nvim/testdir/test_retab.vim @@ -92,11 +92,7 @@ func RetabLoop() endfunc func Test_retab_endless() - " FIXME: why does this hang on MS-Windows? - CheckNotMSWindows - " inside try/catch we catch the error message - new call setline(1, "\t0\t") let caught = 'no' try @@ -105,20 +101,21 @@ func Test_retab_endless() let caught = v:exception endtry call assert_match('E1240:', caught) - bwipe! + set tabstop& endfunc func Test_nocatch_retab_endless() - " FIXME: does this hang on MS-Windows? - CheckNotMSWindows + " FIXME: why does this hang on MS-Windows? Is got_int reset somewhere? + if has('win32') + let g:skipped_reason = "does not work on MS-Windows" + return + endif " not inside try/catch an interrupt is generated to get out of loops - new call setline(1, "\t0\t") call assert_fails('call RetabLoop()', ['E1240:', 'Interrupted']) - bwipe! set tabstop& endfunc -- cgit From 22622df950fe90abcaaf2e6710cd6cd9451cdc34 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 30 Nov 2022 10:07:24 +0800 Subject: vim-patch:8.2.5108: retab test disabled because it hangs on MS-Windows Problem: Retab test disabled because it hangs on MS-Windows. Solution: Also set got_int at the other place a overlong text is detected. https://github.com/vim/vim/commit/308660bd263367a4f1a75498cbd2e29cade47f4d Co-authored-by: Bram Moolenaar --- src/nvim/testdir/test_retab.vim | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_retab.vim b/src/nvim/testdir/test_retab.vim index 4253e77487..a4f95053c0 100644 --- a/src/nvim/testdir/test_retab.vim +++ b/src/nvim/testdir/test_retab.vim @@ -92,7 +92,7 @@ func RetabLoop() endfunc func Test_retab_endless() - " inside try/catch we catch the error message + " inside try/catch we can catch the error message call setline(1, "\t0\t") let caught = 'no' try @@ -106,13 +106,7 @@ func Test_retab_endless() endfunc func Test_nocatch_retab_endless() - " FIXME: why does this hang on MS-Windows? Is got_int reset somewhere? - if has('win32') - let g:skipped_reason = "does not work on MS-Windows" - return - endif - - " not inside try/catch an interrupt is generated to get out of loops + " when not inside try/catch an interrupt is generated to get out of loops call setline(1, "\t0\t") call assert_fails('call RetabLoop()', ['E1240:', 'Interrupted']) -- cgit