From: Junio C Hamano Date: Tue, 28 May 2013 17:28:46 GMT Subject: Re: [PATCH 4/5] test: improve rebase -q test Message-ID: <7vfvx710a9.fsf@alter.siamese.dyndns.org> In-Reply-To: <20130528171907.GA28153@google.com> Jonathan Nieder writes: > Junio C Hamano wrote: > >> A more preferrable alternative may be adding something like this to >> test-lib.sh and call it from here and elsewhere (there are about 50 >> places that do "test ! -s "), perhaps? >> >> test_must_be_an_empty_file () { >> if test -s "$1" >> then >> cat "$1" >> false >> fi >> } > > I generally just use the two-liner > > >empty && > test_cmp empty output > > directly in cases like this. That would work, too.