aboutsummaryrefslogtreecommitdiffstats
path: root/t/t9137-git-svn-dcommit-clobber-series.sh
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-03 07:06:02 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-07 14:47:39 -0700
commitcdbdc6bf8caddc32e5fae7bfe4a63c54be21093f (patch)
tree4ff7685e733a340dc1bd3e88e57c483b62f27efb /t/t9137-git-svn-dcommit-clobber-series.sh
parentt: refactor tests depending on Perl transliteration operator (diff)
downloadgit-cdbdc6bf8caddc32e5fae7bfe4a63c54be21093f.tar.gz
git-cdbdc6bf8caddc32e5fae7bfe4a63c54be21093f.zip
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>
Diffstat (limited to 't/t9137-git-svn-dcommit-clobber-series.sh')
-rwxr-xr-xt/t9137-git-svn-dcommit-clobber-series.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/t/t9137-git-svn-dcommit-clobber-series.sh b/t/t9137-git-svn-dcommit-clobber-series.sh
index a9d38be997..b57a362bb9 100755
--- a/t/t9137-git-svn-dcommit-clobber-series.sh
+++ b/t/t9137-git-svn-dcommit-clobber-series.sh
@@ -15,13 +15,13 @@ test_expect_success 'initialize repo' '
test -e file
'
-test_expect_success PERL_TEST_HELPERS '(supposedly) non-conflicting change from SVN' '
+test_expect_success '(supposedly) non-conflicting change from SVN' '
test x"$(sed -n -e 58p < file)" = x58 &&
test x"$(sed -n -e 61p < file)" = x61 &&
svn_cmd co "$svnrepo" tmp &&
(cd tmp &&
- perl -i.bak -p -e "s/^58$/5588/" file &&
- perl -i.bak -p -e "s/^61$/6611/" file &&
+ sed -e "s/^58$/5588/" -e "s/^61$/6611/" file >file.munged &&
+ mv file.munged file &&
poke file &&
test x"$(sed -n -e 58p < file)" = x5588 &&
test x"$(sed -n -e 61p < file)" = x6611 &&
@@ -37,11 +37,13 @@ test_expect_success 'some unrelated changes to git' "
git commit -m bye-life life
"
-test_expect_success PERL_TEST_HELPERS 'change file but in unrelated area' "
+test_expect_success 'change file but in unrelated area' "
test x\"\$(sed -n -e 4p < file)\" = x4 &&
test x\"\$(sed -n -e 7p < file)\" = x7 &&
- perl -i.bak -p -e 's/^4\$/4444/' file &&
- perl -i.bak -p -e 's/^7\$/7777/' file &&
+ sed -e 's/^4\$/4444/' \
+ -e 's/^7\$/7777/' \
+ file >file.munged &&
+ mv file.munged file &&
test x\"\$(sed -n -e 4p < file)\" = x4444 &&
test x\"\$(sed -n -e 7p < file)\" = x7777 &&
git commit -m '4 => 4444, 7 => 7777' file &&