summaryrefslogtreecommitdiffstats
path: root/src/testdir/runtest.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-06-15 20:49:35 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-15 20:49:35 +0100
commit8bea171f154845046239c61bdef50a8e0f12f643 (patch)
treeda8174d7704421002afd6c1b31c4ce21505d16ff /src/testdir/runtest.vim
parentcf65d88ff844f042337dfd043e6e98f3b9270577 (diff)
patch 8.2.5102: interrupt not caught in testv8.2.5102
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.
Diffstat (limited to 'src/testdir/runtest.vim')
-rw-r--r--src/testdir/runtest.vim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index db6797d1b0..c7d5704e9a 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -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.