Re: [PATCH 04/15] t0003: use named parameters in attr_check()
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 17, 2019, 18:43 UTC
- Message-ID
- <CAPig+cQ4=CeGJmVp4S9xdR9UVN2mLRndX7+cCdSn8rhaEgdcmg@mail.gmail.com>
- In-Reply-To
- <f1acb2a0dfb39a4ff047d721edde821e9e296e72.1576583819.git.liu.denton@gmail.com>
On Tue, Dec 17, 2019 at 7:01 AM Denton Liu <liu.denton@gmail.com> wrote:
Show 7 quoted lines
> We had named the parameters in attr_check() but $2 was being used > instead of $expect. Make all variable accesses in attr_check() use named > variables instead of numbered arguments for clarity. > > While we're at it, add variable assignments to the &&-chain. These > aren't ever expected to fail but for stylistic purposes, include them > anyway for stylistic purposes.
As a justification, "stylistic purposes" isn't very strong. However, a solid justification is that keeping the &&-chain intact even for these assignments means that if someone comes along in the future and inserts code _above_ the assignments, and if that code could fail in some way, then the intact &&-chain will ensure that that failure is noticed rather than going unnoticed.
> Signed-off-by: Denton Liu <liu.denton@gmail.com>