From: Jeff King Date: Mon, 10 Jun 2013 20:41:24 GMT Subject: Re: [PATCH 2/3] test: improve rebase -q test Message-ID: <20130610204123.GB13333@sigill.intra.peff.net> In-Reply-To: <7vd2rvqgra.fsf@alter.siamese.dyndns.org> On Sun, Jun 09, 2013 at 11:30:01AM -0700, Junio C Hamano wrote: > -- >8 -- > Subject: [PATCH] test: test_output_must_be_empty helper > > There are quite a lot places where an output file is expected to be > empty, and we fail the test when it is not. The output from running > the test script with -i -v can be helped if we showed the unexpected > contents at that point. > > We could of course do > > >expected.empty && test_cmp expected.empty actual > > but this is commmon enough to be done with a dedicated helper. Thanks, I think this improves the readability of the test suite (and its output when there are failures). You can also do: test_cmp /dev/null actual for the same effect, but I guess the diff is not all that interesting (by definition, it would consist only of added lines, and you are already showing them, so it would not be an improvement). -Peff