Subject: Re: [PATCH 05/11] t7450: make test "set -e" clean

From: Patrick Steinhardt <[email-masked]>
Date: Wed, 25 Mar 2026 08:15:47 +0100

On Tue, Mar 24, 2026 at 11:21:08PM -0700, Junio C Hamano wrote:
> In order to catch mistakes like misspelling "test_expect_success",
> we would like to eventually be able to run our test suite with the
> "-e" option on.
> 
> Often we write "A && test_expect_success ..." and want it to mean
> "If and only if A holds true, this needs to be tested", but under
> "set -e", this will cause failure when A does not hold true.  We
> need to write "!A || test_expect_success ..." if we want to run the
> test conditionally.
> 
> Or write it properly with if/then/fi, perhaps like:
> 
> 	if ! A
> 	then
> 		test_expect_success ...
> 	fi

Yeah, that's what I have, mostly because I find it easier to reason
about.

Patrick