git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Jeff King <peff@peff.net>, git@vger.kernel.org
Subject: Re: [RFC/PATCH 0/2] here-doc test bodies
Date: Fri, 9 Apr 2021 21:03:24 -0400	[thread overview]
Message-ID: <42b187cb-6417-0353-cf63-c6379be53208@gmail.com> (raw)
In-Reply-To: <YHDUg6ZR5vu93kGm@coredump.intra.peff.net>

On 4/9/2021 6:26 PM, Jeff King wrote:
> I've been wanting to do this for years, but after getting bitten by a
> misplaced quote the other day, I finally did. This series allows you to
> do:
> 
>   test_expect_success <<\EOT
>           something 'with single quotes'
>   EOT
> 
> Thoughts?

Odd. I _just_ hit this for the first time today. I didn't know
about the $SQ trick, so I just modified my 'sed' call to drop
the single quotes from the string I was trying to match [1].

[1] https://lore.kernel.org/git/36aa6837-722c-9ef0-84cc-77e982db9f6e@gmail.com/

I think this is a good pattern for this kind of thing. I
imagine that if the test itself needed heredocs, then they
would be interpreted correctly when evaluating stdin (as
long as a different identifier is used).

I also like the "EOT" pattern as an example.

Thanks,
-Stolee

  parent reply	other threads:[~2021-04-10  1:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09 22:26 [RFC/PATCH 0/2] here-doc test bodies Jeff King
2021-04-09 22:28 ` [PATCH 1/2] test-lib: allow test snippets as here-docs Jeff King
2021-04-09 22:30   ` Jeff King
2021-04-09 22:56   ` Junio C Hamano
2021-04-10  0:57     ` Junio C Hamano
2021-04-10  1:26       ` Jeff King
2021-04-10  8:30   ` Ævar Arnfjörð Bjarmason
2021-04-09 22:28 ` [PATCH 2/2] t1404: convert to here-doc test bodies Jeff King
2021-04-10  1:03 ` Derrick Stolee [this message]
2021-04-10  1:34   ` [RFC/PATCH 0/2] " Jeff King

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=42b187cb-6417-0353-cf63-c6379be53208@gmail.com \
    --to=stolee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).