Subject: Re: [PATCH 01/11] test-lib: catch misspelt 'test_expect_successo'

From: Junio C Hamano <[email-masked]>
Date: Thu, 26 Mar 2026 07:27:44 -0700

Jeff King <[email-masked]> writes:

> diff --git a/t/t0005-signals.sh b/t/t0005-signals.sh
> index afba0fc3fc..0bf1f16750 100755
> --- a/t/t0005-signals.sh
> +++ b/t/t0005-signals.sh
> @@ -42,7 +42,7 @@ test_expect_success 'create blob' '
>  '
>  
>  test_expect_success !MINGW 'a constipated git dies with SIGPIPE' '
> -	OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 ) &&
> +	OUT=$( ((large_git || echo $? 1>&3) | :) 3>&1 ) &&
>  	test_match_signal 13 "$OUT"
>  '
>  
>
> That neglects to echo $? when large_git surprisingly succeeds, but that
> would mean $OUT is empty, which would cause the test to (correctly)
> fail. I kind of hate it, though.

Would

	OUT=$( ((large_git && echo 0 || echo $? 1>&3) | :) 3>&1 )

do a bit better?

We can keep fixing things one by one as we find these little
glitches and gochas, of it may be a whack-a-mole exercise that
eventually will turn out to be futile.  I dunno.

In any case, the "Add 'set -e' to test-lib.sh to affect everybody"
step has to come at the very end of the series to keep tests pass at
each step, I guess.  I wonder how much better Patrick's version
does...