Re: [PATCH 4/5] test: improve rebase -q test
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- May 28, 2013, 17:19 UTC
- Message-ID
- <20130528171907.GA28153@google.com>
- In-Reply-To
- <7vvc6311dr.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 11 quoted lines
> 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 <filename>"), 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.
Thanks, Jonathan