Re: [PATCH 3/3] t/chainlint: add tests for test body in heredoc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux