Re: [PATCH v3 11/20] t: refactor tests depending on Perl substitution operator
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Apr 1, 2025, 18:32 UTC
- Message-ID
- <70026fe9-8c99-ab00-531f-1556db63b0d8@gmx.de>
- In-Reply-To
- <20250327-b4-pks-t-perlless-v3-11-b436de9da1b8@pks.im>
Hi Patrick,
On Thu, 27 Mar 2025, Patrick Steinhardt wrote:
> We have a bunch of tests that use Perl to perform substitution via the > "s/" operator. These usecases can be trivially replaced with sed(1).
... and sometimes `tr`.
In fact, it looks like...
Show 16 quoted lines
> diff --git a/t/t7508-status.sh b/t/t7508-status.sh > index 14c41b2cb7c..cdc1d6fcc78 100755 > --- a/t/t7508-status.sh > +++ b/t/t7508-status.sh > @@ -1064,9 +1064,9 @@ test_expect_success 'status -s submodule summary (clean submodule)' ' > test_cmp expect output > ' > > -test_expect_success PERL_TEST_HELPERS 'status -z implies porcelain' ' > +test_expect_success 'status -z implies porcelain' ' > git status --porcelain | > - perl -pe "s/\012/\000/g" >expect && > + tr "\012" "\000" >expect && > git status -z >output && > test_cmp expect output > '
... this change is not about `sed` at all, but only about `tr`. _Technically_, this hunk would therefore feel more at home in the previous patch. But practically, I actually do not mind it being here at all.
Thank you, Johannes