Re: [PATCH] t7006: guard cleanup with test_expect_success
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 15, 2010, 01:27 UTC
- Message-ID
- <20100415012752.GA17132@progeny.tock>
- In-Reply-To
- <7v7ho9mt3a.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
[...]
Show 6 quoted lines
>> +cleanup_fail() {
>> + echo >&2 cleanup failed
>> + exit 1
>> +}
>
> I think you meant to say "false" or "(exit 1)" here. To see why...[...]
> ... try your patch with "rm -f stdout_is_tty" replaced with "(exit 1)" to > see how your cleanup_fail behaves.
Good catch; thanks. Here’s a patch for squashing in case you would like one.
diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh index 62595ab..a3d0210 100755 --- a/t/t7006-pager.sh +++ b/t/t7006-pager.sh @@ -6,7 +6,7 @@ test_description='Test automatic use of a pager.' cleanup_fail() { echo >&2 cleanup failed - exit 1 + return 1 } test_expect_success 'set up terminal for tests' '