git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: "René Scharfe" <l.s.r@web.de>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] test: use test_must_be_empty F instead of test_cmp empty F
Date: Tue, 26 Nov 2019 12:02:39 -0800	[thread overview]
Message-ID: <20191126200239.GA36748@generichostname> (raw)
In-Reply-To: <52479277-b753-c3c0-7f6c-5d013016964e@web.de>

Hi René,

On Tue, Nov 26, 2019 at 08:46:34PM +0100, René Scharfe wrote:
> Use test_must_be_empty instead of comparing it to an empty file.  That's
> more efficient, as the function only needs built-in meta-data only check
> in the usual case, and provides nicer debug output otherwise.
> 
> Signed-off-by: René Scharfe <l.s.r@web.de>

Nice, I like test cleanup :)

> ---

[...]

> diff --git a/t/t9010-svn-fe.sh b/t/t9010-svn-fe.sh
> index 0b20b07e68..3a3d8d3bd5 100755
> --- a/t/t9010-svn-fe.sh
> +++ b/t/t9010-svn-fe.sh
> @@ -53,9 +53,7 @@ text_no_props () {
>  	printf "%s\n" "$text"
>  }
> 
> ->empty
> -
> -test_expect_success 'empty dump' '
> +test_expect_success PIPE 'empty dump' '

How come we need the PIPE prereq here? At the top of this file, we have

	if test_have_prereq !PIPE
	then
		skip_all="svn dumpfile importer testing requires the PIPE prerequisite"
		test_done
	fi

which should guarantee PIPE at this point already.

Thanks,

Denton

>  	reinit_git &&
>  	echo "SVN-fs-dump-format-version: 2" >input &&
>  	try_dump input
> @@ -208,7 +206,7 @@ test_expect_failure 'timestamp and empty file' '
>  	test_cmp expect.date actual.date &&
>  	test_cmp expect.files actual.files &&
>  	git checkout HEAD empty-file &&
> -	test_cmp empty file
> +	test_must_be_empty file
>  '
> 
>  test_expect_success 'directory with files' '
> --
> 2.24.0
> 

  reply	other threads:[~2019-11-26 20:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 19:46 [PATCH] test: use test_must_be_empty F instead of test_cmp empty F René Scharfe
2019-11-26 20:02 ` Denton Liu [this message]
2019-11-27  7:51   ` René Scharfe
2019-11-27  7:51 ` [PATCH v2] " René Scharfe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191126200239.GA36748@generichostname \
    --to=liu.denton@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).