1
0
forked from aniani/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.
This commit is contained in:
Bram Moolenaar
2022-06-15 20:49:35 +01:00
parent cf65d88ff8
commit 8bea171f15
5 changed files with 31 additions and 12 deletions

View File

@@ -201,6 +201,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.
@@ -212,9 +213,7 @@ func RunTheTest(test)
endif
else
try
au VimLeavePre * call EarlyExit(g:testfunc)
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\+', '', ''))
@@ -222,6 +221,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.