git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: "Michael Rappazzo" <rappazzo@gmail.com>,
	"Git List" <git@vger.kernel.org>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Nguyễn Thái Ngọc" <pclouds@gmail.com>,
	"SZEDER Gábor" <szeder@ira.uka.de>
Subject: Re: [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command
Date: Sun, 17 Apr 2016 02:41:40 -0400	[thread overview]
Message-ID: <20160417064140.GA31993@sigill.intra.peff.net> (raw)
In-Reply-To: <CAPig+cTOa2yaMikOJHQXpSjY_EtyUXaqVz4KobQwO2xn=Q6h_w@mail.gmail.com>

On Sun, Apr 17, 2016 at 02:36:24AM -0400, Eric Sunshine wrote:

> Agreed. I wouldn't mind the version where test_stdout grabs "expected"
> from <<EOF, but, as you say, it doesn't buy much over the manually
> prepared test_cmp version.
> 
> I suppose that the one-liner form of test_stdout could have its uses,
> however, it bothers me for a couple reasons: (1) it's not generally
> useful like the version which grabs "expected" from <<EOF, (2) it
> squats on a nice concise name which would better suit the <<EOF
> version.

I think you could get around your second objection by making "-" a magic
token, like:

  test_stdout - = git rev-parse ... <<-\EOF
  false
  EOF

Though I admit the combination of "-" and "=" is pretty ugly to read.

I'm OK with abandoning this line of inquiry, too. This may be a case
where a little repetition makes things a lot less magical to a reader,
and it's not worth trying to devise the perfect helper.

> Anyhow, this may all be moot (for now) since I think this patch series
> is going in the wrong direction entirely by abandoning the systematic
> approach taken by the original t1500 code, as explained in my
> review[1]. If modernization of t1500 retains a systematic approach,
> then the repetitive code which prompted the suggestion of test_stdout
> won't exist in the first place.

Fair enough. I haven't really followed the other part of the series very
closely.

-Peff

  reply	other threads:[~2016-04-17  6:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-16 16:13 [PATCH v2 0/2] t1500-rev-parse: re-write t1500 Michael Rappazzo
2016-04-16 16:13 ` [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command Michael Rappazzo
2016-04-17  3:07   ` Eric Sunshine
2016-04-17  3:54     ` Jeff King
2016-04-17  6:36       ` Eric Sunshine
2016-04-17  6:41         ` Jeff King [this message]
2016-04-17 15:19     ` Johannes Sixt
2016-04-17 16:22       ` Eric Sunshine
2016-04-16 16:13 ` [PATCH v2 2/2] t1500-rev-parse: rewrite each test to run in isolation Michael Rappazzo
2016-04-17  5:59   ` Eric Sunshine
2016-04-17 15:05     ` Johannes Sixt
2016-04-17  9:42   ` SZEDER Gábor
2016-04-17 16:15     ` Eric Sunshine

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=20160417064140.GA31993@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=rappazzo@gmail.com \
    --cc=sunshine@sunshineco.com \
    --cc=szeder@ira.uka.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).