Re: [PATCH 12/19] tests: fix broken &&-chains in `{...}` groups
- From
Jeff King <peff@peff.net>
- Date
- Dec 10, 2021, 09:29 UTC
- Message-ID
- <YbMd4cuRs9aiPWbX@coredump.intra.peff.net>
- In-Reply-To
- <20211209051115.52629-13-sunshine@sunshineco.com>
On Thu, Dec 09, 2021 at 12:11:08AM -0500, Eric Sunshine wrote:
Show 11 quoted lines
> The top-level &&-chain checker built into t/test-lib.sh causes tests to
> magically exit with code 117 if the &&-chain is broken. However, it has
> the shortcoming that the magic does not work within `{...}` groups,
> `(...)` subshells, `$(...)` substitutions, or within bodies of compound
> statements, such as `if`, `for`, `while`, `case`, etc. `chainlint.sed`
> partly fills in the gap by catching broken &&-chains in `(...)`
> subshells, but bugs can still lurk behind broken &&-chains in the other
> cases.
>
> Fix broken &&-chains in `{...}` groups in order to reduce the number of
> possible lurking bugs.Seems good. This is mostly stuff we don't expect to fail (mostly "echo"), so I doubt they're important on their own. But getting a clean state for the linter _is_ important.
-Peff