Re: [PATCH] t6024-recursive-merge.sh: hide spurious output when not running verbosely
- From
Jeff King <peff@peff.net>
- Date
- Feb 29, 2008, 23:01 UTC
- Message-ID
- <20080229230156.GA8742@coredump.intra.peff.net>
- In-Reply-To
- <20080229225816.GA24892@glandium.org>
On Fri, Feb 29, 2008 at 11:58:16PM +0100, Mike Hommey wrote:
Show 11 quoted lines
> > > -git reset --hard > > > +git reset --hard >&3 2>&4 > > > test_expect_success 'refuse to merge binary files' ' > > > printf "\0" > binary-file && > > > git add binary-file && > > > > Should this perhaps just be: > > > > test_expect_success 'reset state' 'git reset --hard' > > Is it really about testing git reset ?
No, of course not. Nor is t0003 about testing 'setup'. But it is a convention[1] in git tests to do everything inside a test_expect_success wrapper, which is beneficial because:
- you get your output handled properly automagically :)
- if the setup step fails, we notice. Which means:
- it cannot silently cause a later test to succeed (e.g., setup
changes a file, then the real test reverts it)
- it is easier to debug failing tests, because you are notified
of the _first_ failure-Peff
[1] By convention, I don't necessarily mean that there is a written rule, nor that we always do it that way, but only that in my experience we usually do. Somebody like Junio could say more definitely what is preferred.