From: Jeff King Date: Mon, 08 Jul 2024 08:59:09 GMT Subject: Re: [PATCH 3/3] t/chainlint: add tests for test body in heredoc Message-ID: <20240708085909.GB819809@coredump.intra.peff.net> In-Reply-To: On Sun, Jul 07, 2024 at 10:43:45PM -0400, Eric Sunshine wrote: > This one made me think of an additional pathological case, though I'm > not sure it's worth having a test: > > test_expect_success 'pathological-here-doc-body' - <<\EOF > echo "missing chain before" > cat >file <<-\EOF && > inside inner here-doc > these are not shell commands > EOF > echo "missing chain after" > echo "but this line is OK because it's the end" > EOF > > It's exactly the same as your test except that the same tag ("EOF") is > used for both outer and inner heredocs. It works because the outer > heredoc is introduced with `<<` whereas the inner with `<<-`. The > opposite case, in which outer is introduced with `<<-` and inner with > `<<`, obviously would be bogus. Ooh, that's devious. I'll add it. -Peff