diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-04-03 07:06:01 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-07 14:47:38 -0700 |
| commit | db8ff64a3a5244b44e27e0d46a48a304a2e36456 (patch) | |
| tree | 25af3e5f4f6d9b274297827c6c5b8007ddb7748e /t/t4103-apply-binary.sh | |
| parent | Makefile: stop requiring Perl when running tests (diff) | |
| download | git-db8ff64a3a5244b44e27e0d46a48a304a2e36456.tar.gz git-db8ff64a3a5244b44e27e0d46a48a304a2e36456.zip | |
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/t4103-apply-binary.sh')
| -rwxr-xr-x | t/t4103-apply-binary.sh | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/t/t4103-apply-binary.sh b/t/t4103-apply-binary.sh index 59d38793ae..8e302a5a57 100755 --- a/t/t4103-apply-binary.sh +++ b/t/t4103-apply-binary.sh @@ -11,12 +11,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh -if ! test_have_prereq PERL_TEST_HELPERS -then - skip_all='skipping apply-binary tests; Perl not available' - test_done -fi - test_expect_success 'setup' ' cat >file1 <<-\EOF && A quick brown fox jumps over the lazy dog. @@ -32,10 +26,10 @@ test_expect_success 'setup' ' git commit -m "Initial Version" 2>/dev/null && git checkout -b binary && - perl -pe "y/x/\000/" <file1 >file3 && + tr "x" "\000" <file1 >file3 && cat file3 >file4 && git add file2 && - perl -pe "y/\000/v/" <file3 >file1 && + tr "y" "\000" <file3 >file1 && rm -f file2 && git update-index --add --remove file1 file2 file3 file4 && git commit -m "Second Version" && @@ -164,7 +158,7 @@ test_expect_success 'apply binary -p0 diff' ' test -z "$(git diff --name-status binary -- file3)" ' -test_expect_success 'reject truncated binary diff' ' +test_expect_success PERL_TEST_HELPERS 'reject truncated binary diff' ' do_reset && # this length is calculated to get us very close to |
