Skip to content

Commit 4686b32

Browse files
committed
patch 7.4.981
Problem: An error in a test script goes unnoticed. Solution: Source the test script inside try/catch. (Hirohito Higashi)
1 parent 57d7971 commit 4686b32

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/testdir/runtest.vim

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
" It will be called after each Test_ function.
2222

2323
" Without the +eval feature we can't run these tests, bail out.
24-
if 0
25-
quit!
26-
endif
24+
so small.vim
2725

2826
" Check that the screen size is at least 24 x 80 characters.
2927
if &lines < 24 || &columns < 80
@@ -38,17 +36,22 @@ endif
3836
" Source the test script. First grab the file name, in case the script
3937
" navigates away.
4038
let testname = expand('%')
41-
source %
39+
let done = 0
40+
let fail = 0
41+
let errors = []
42+
try
43+
source %
44+
catch
45+
let fail += 1
46+
call add(errors, 'Caught exception: ' . v:exception . ' @ ' . v:throwpoint)
47+
endtry
4248

4349
" Locate Test_ functions and execute them.
4450
redir @q
4551
function /^Test_
4652
redir END
4753
let tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g'))
4854

49-
let done = 0
50-
let fail = 0
51-
let errors = []
5255
for test in tests
5356
if exists("*SetUp")
5457
call SetUp()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
981,
744746
/**/
745747
980,
746748
/**/

0 commit comments

Comments
 (0)