Re: [PATCH 2/3] t/chainlint: add test_expect_success call to test snippets
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 8, 2024, 03:59 UTC
- Message-ID
- <CAPig+cTfMf_t93arsTCq-7fSooiBKRw1L=DVmSX8Pp7xMJM9Sw@mail.gmail.com>
- In-Reply-To
- <20240706060951.GA700433@coredump.intra.peff.net>
On Sat, Jul 6, 2024 at 2:09 AM Jeff King <peff@peff.net> wrote:
Show 10 quoted lines
> > for i in $(CHAINLINTTESTS); do \ > > - echo "test_expect_success '$$i' '" && \ > > - sed -e '/^# LINT: /d' chainlint/$$i.test && \ > > - echo "'"; \ > > + sed -e '/^# LINT: /d' chainlint/$$i.test; \ > > done >'$(CHAINLINTTMP_SQ)'/tests && \ > > BTW, not new in my patch, but I found it ironic that the shell snippet > here itself violates &&-chain rules. It should "|| exit 1" inside the > loop if a sed call fails.
Indeed, what an embarrassing oversight, especially since this loop was added in preparation for chainlint.pl which diagnoses missing `|| exit` (or `|| return`) in loops in tests (unlike chainlint.sed which didn't).