All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: "Bert Wesarg" <bert.wesarg@googlemail.com>,
	"Junio C Hamano" <gitster@pobox.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>
Subject: [PATCH] t4014: treat rev-list output as the expected value
Date: Tue, 8 Oct 2019 02:14:11 -0700	[thread overview]
Message-ID: <30d03ed76e46a10bea883ba3fe85b186fbf31d25.1570526007.git.liu.denton@gmail.com> (raw)
In-Reply-To: <20191007210306.GF11529@szeder.dev>

In 6bd26f58ea (t4014: use test_line_count() where possible, 2019-08-27),
we converted many test cases to take advantage of the test_line_count()
function. In one conversion, we inverted the expected and actual value
as tested by test_line_count(). Although functionally correct, if
format-patch ever produced incorrect output, the debugging output would
be a bunch of hashes which would be difficult to debug.

Invert the expected and actual values provided to test_line_count() so
that if format-patch produces incorrect output, the debugging output
will be a list of human-readable files instead.

Helped-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
---
Thanks for point out my mistake, Szeder. This patch can be applied to
the tip of 'dl/format-patch-doc-test-cleanup' and then we should base
Bert's changes on top of this branch.

 t/t4014-format-patch.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 83f52614d3..72b09896cf 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -1610,8 +1610,9 @@ test_expect_success 'format-patch format.outputDirectory option' '
 	test_config format.outputDirectory patches &&
 	rm -fr patches &&
 	git format-patch master..side &&
-	git rev-list master..side >list &&
-	test_line_count = $(ls patches | wc -l) list
+	count=$(git rev-list --count master..side) &&
+	ls patches >list &&
+	test_line_count = $count list
 '
 
 test_expect_success 'format-patch -o overrides format.outputDirectory' '
-- 
2.23.0.248.g3a9dd8fb08


  parent reply	other threads:[~2019-10-08  9:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 21:26 [PATCH 1/3] format-patch: document and exercise that -o does only create the trailing directory Bert Wesarg
2019-10-02 21:26 ` [PATCH 2/3] format-patch: create output directory including leading components Bert Wesarg
2019-10-03  0:54   ` Junio C Hamano
2019-10-02 21:26 ` [RFC PATCH 3/3] format-patch: use a command to generate the output directory name Bert Wesarg
2019-10-03  0:57   ` Junio C Hamano
2019-10-05  8:43   ` [PATCH v2 1/2] format-patch: create leading components of output directory Bert Wesarg
2019-10-05  8:43     ` [PATCH v2 2/2] [RFC] format-patch: configure a command to generate the output directory name Bert Wesarg
2019-10-06  0:57     ` [PATCH v2 1/2] format-patch: create leading components of output directory Junio C Hamano
2019-10-07 21:03     ` SZEDER Gábor
2019-10-08  3:23       ` Junio C Hamano
2019-10-08  9:06       ` Bert Wesarg
2019-10-08  9:14       ` Denton Liu [this message]
2019-10-02 21:47 ` [PATCH 1/3] format-patch: document and exercise that -o does only create the trailing directory Denton Liu
2019-10-03 16:34   ` Bert Wesarg

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=30d03ed76e46a10bea883ba3fe85b186fbf31d25.1570526007.git.liu.denton@gmail.com \
    --to=liu.denton@gmail.com \
    --cc=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=szeder.dev@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.