]> git.ipfire.org Git - thirdparty/git.git/commit
t: refactor tests depending on Perl for textconv scripts
authorPatrick Steinhardt <ps@pks.im>
Thu, 3 Apr 2025 05:06:04 +0000 (07:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Apr 2025 21:47:39 +0000 (14:47 -0700)
commit4a7af4edbb800ff8ed0cd131423f45c2c76e1200
treede11e6515671a414ec048a079557685f72271cb0
parent6aec8d38fddf22fa9fd3194acc2b891d295b5fbc
t: refactor tests depending on Perl for textconv scripts

We have a couple of tests that depend on Perl for textconv scripts.
Refactor these tests to instead be implemented via shell utilities so
that we can drop a couple of PERL_TEST_HELPERS prerequisites.

Note that the conversion in t4030 is not a one-to-one equivalent to the
previous textconv script. Before this change we used to essentially do a
hexdump via Perl. The obvious conversion here would be to use `test-tool
hexdump` like we do for the other tests. But this would lead to a ripple
effect where we would have to adapt a bunch of other tests with a bunch
of seemingly unrelated changes, which would be somewhat awkward.

Instead, we're going with the minimum viable change: the test files we
write contain "\001" and "\000", and the test's expectation is that
those get translated into proper ASCII characters. So instead of doing a
full hexdump, we simply use tr(1) to translate these specific bytes.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4030-diff-textconv.sh
t/t4031-diff-rewrite-binary.sh
t/t7815-grep-binary.sh