aboutsummaryrefslogtreecommitdiffstats
path: root/t/lib-diff.sh
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-03 07:06:01 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:47:38 -0700
commitdb8ff64a3a5244b44e27e0d46a48a304a2e36456 (patch)
tree25af3e5f4f6d9b274297827c6c5b8007ddb7748e /t/lib-diff.sh
parent8d531a9d18d658f696de5a71458e832317b7ca5a (diff)
downloadgit-db8ff64a3a5244b44e27e0d46a48a304a2e36456.tar.gz
t: refactor tests depending on Perl transliteration operator
We have a bunch of tests that use Perl to perform character transliteration via the "y/" or "tr/" operator. These usecases can be trivially replaced with 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>
Diffstat (limited to 't/lib-diff.sh')
-rw-r--r--t/lib-diff.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/lib-diff.sh b/t/lib-diff.sh
index c4606bd4b7..12b3c8fcc6 100644
--- a/t/lib-diff.sh
+++ b/t/lib-diff.sh
@@ -21,8 +21,8 @@ compare_diff_raw_z () {
# Also we do not check SHA1 hash generation in this test, which
# is a job for t0000-basic.sh
- perl -pe 'y/\000/\012/' <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1
- perl -pe 'y/\000/\012/' <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2
+ tr "\000" "\012" <"$1" | sed -e "$sanitize_diff_raw_z" >.tmp-1
+ tr "\000" "\012" <"$2" | sed -e "$sanitize_diff_raw_z" >.tmp-2
test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2
}