t: refactor tests depending on Perl substitution operator

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
tr(1).

Refactor the tests accordingly so that we can drop a couple of
PERL_TEST_HELPERS prerequisites.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2025-04-03 07:06:02 +02:00
committed by Junio C Hamano
parent db8ff64a3a
commit cdbdc6bf8c
11 changed files with 40 additions and 60 deletions

View File

@@ -18,7 +18,7 @@ index 5f6a263..8cb8bae 100644
EOF
exit 1
test_expect_success PERL_TEST_HELPERS "$test_description" '
test_expect_success "$test_description" '
printf "\nx\n" > f &&
before=$(git hash-object f) &&
before=$(git rev-parse --short $before) &&
@@ -31,7 +31,8 @@ test_expect_success PERL_TEST_HELPERS "$test_description" '
git config --bool diff.suppressBlankEmpty true &&
git diff f > actual &&
test_cmp exp actual &&
perl -i.bak -p -e "s/^\$/ /" exp &&
sed "s/^\$/ /" exp >exp.munged &&
mv exp.munged exp &&
git config --bool diff.suppressBlankEmpty false &&
git diff f > actual &&
test_cmp exp actual &&