From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] tests: fix diff order arguments in test_cmp
Date: Sat, 07 Oct 2017 11:29:19 +0900 [thread overview]
Message-ID: <xmqqwp47u1vk.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20171006190006.19623-2-sbeller@google.com> (Stefan Beller's message of "Fri, 6 Oct 2017 12:00:06 -0700")
Stefan Beller <sbeller@google.com> writes:
> diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
> index ec5f530102..42f584f8b3 100755
> --- a/t/t4205-log-pretty-formats.sh
> +++ b/t/t4205-log-pretty-formats.sh
> @@ -590,7 +590,7 @@ test_expect_success '%(trailers:unfold) unfolds trailers' '
> test_expect_success ':only and :unfold work together' '
> git log --no-walk --pretty="%(trailers:only:unfold)" >actual &&
> git log --no-walk --pretty="%(trailers:unfold:only)" >reverse &&
> - test_cmp actual reverse &&
> + test_cmp reverse actual &&
> {
> grep -v patch.description <trailers | unfold &&
> echo
This test is trying to see that giving the two modifers in any order
produces identical results, so the result of swaping is no more or
no less correct than the original, because what this test calls
"actual" is no less authoritative result than what is in "reverse"
at this point, which is the reason why we prefer "expect actual" in
the typical use of test_cmp.
Renaming <actual, reverse> to (rather meaningless) <one, two> or
<only-unfold, unfold-only> might make the intention a bit clearer.
THanks.
next prev parent reply other threads:[~2017-10-07 2:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-06 19:00 [PATCH 1/2] tests: use shell negation instead of test_must_fail for test_cmp Stefan Beller
2017-10-06 19:00 ` [PATCH 2/2] tests: fix diff order arguments in test_cmp Stefan Beller
2017-10-06 22:01 ` Jonathan Nieder
2017-10-06 22:10 ` Stefan Beller
2017-10-07 1:18 ` Junio C Hamano
2017-10-07 2:29 ` Junio C Hamano [this message]
2017-10-06 19:22 ` [PATCH 1/2] tests: use shell negation instead of test_must_fail for test_cmp Jeff King
2017-10-06 19:41 ` Stefan Beller
2017-10-06 21:59 ` Jonathan Nieder
2017-10-07 2:12 ` Junio C Hamano
2017-10-06 20:21 ` Jonathan Nieder
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwp47u1vk.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=sbeller@google.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).