[PATCH/RFC 0/2] test_when_finished and returning early
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Aug 8, 2011, 01:13 UTC
- Message-ID
- <20110808011341.GA19551@elie.gateway.2wire.net>
- In-Reply-To
- <20110324082108.GA30196@elie>
Jonathan Nieder wrote:
Show 7 quoted lines
> The use of "return" was surprising. It seems this style has been > intended to work ever since v0.99.5~24^2~4 (Trapping exit in tests, > using return for errors, 2005-08-10). > > It interacts poorly with test_when_finished but since these tests do > not use that function, they should be safe. test_when_finished could > use some fixes to avoid future surprises but that's another story.
The above was about some code that looks like this:
| for i in 1 2 3 4 5 6 7 8 9 10 11 | do | git checkout -b root$i five || return
The fixes alluded to might go something like this. Thoughts?
Jonathan Nieder (2): test: simplify return value of test_run_ test: cope better with use of return for errors
t/test-lib.sh | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-)