comparison src/testdir/runtest.vim @ 29165:0e0e298e05c1 v8.2.5102

patch 8.2.5102: interrupt not caught in test Commit: https://github.com/vim/vim/commit/8bea171f154845046239c61bdef50a8e0f12f643 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 15 20:49:35 2022 +0100 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.
author Bram Moolenaar <Bram@vim.org>
date Wed, 15 Jun 2022 22:00:04 +0200
parents 8e87a5d2284c
children fba9e366ced4
comparison
equal deleted inserted replaced
29164:152286f40341 29165:0e0e298e05c1
199 catch 199 catch
200 call add(v:errors, 'Caught exception in SetUp() before ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) 200 call add(v:errors, 'Caught exception in SetUp() before ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint)
201 endtry 201 endtry
202 endif 202 endif
203 203
204 au VimLeavePre * call EarlyExit(g:testfunc)
204 if a:test =~ 'Test_nocatch_' 205 if a:test =~ 'Test_nocatch_'
205 " Function handles errors itself. This avoids skipping commands after the 206 " Function handles errors itself. This avoids skipping commands after the
206 " error. 207 " error.
207 let g:skipped_reason = '' 208 let g:skipped_reason = ''
208 exe 'call ' . a:test 209 exe 'call ' . a:test
210 call add(s:messages, ' Skipped') 211 call add(s:messages, ' Skipped')
211 call add(s:skipped, 'SKIPPED ' . a:test . ': ' . g:skipped_reason) 212 call add(s:skipped, 'SKIPPED ' . a:test . ': ' . g:skipped_reason)
212 endif 213 endif
213 else 214 else
214 try 215 try
215 au VimLeavePre * call EarlyExit(g:testfunc)
216 exe 'call ' . a:test 216 exe 'call ' . a:test
217 au! VimLeavePre
218 catch /^\cskipped/ 217 catch /^\cskipped/
219 call add(s:messages, ' Skipped') 218 call add(s:messages, ' Skipped')
220 call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', '')) 219 call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', ''))
221 catch 220 catch
222 call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) 221 call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint)
223 endtry 222 endtry
224 endif 223 endif
224 au! VimLeavePre
225 225
226 " In case 'insertmode' was set and something went wrong, make sure it is 226 " In case 'insertmode' was set and something went wrong, make sure it is
227 " reset to avoid trouble with anything else. 227 " reset to avoid trouble with anything else.
228 set noinsertmode 228 set noinsertmode
229 229