diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-04-03 07:06:06 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-07 14:47:40 -0700 |
| commit | de9eeabd7119afb6c6895e88cb76403c1ec8273a (patch) | |
| tree | 17cb31ea0ef8348fa1da128c0947531be257f1e5 /t/lib-t6000.sh | |
| parent | 3ca6f2058563a371435954fa3782169073823781 (diff) | |
| download | git-de9eeabd7119afb6c6895e88cb76403c1ec8273a.tar.gz | |
t/lib-t6000: refactor `name_from_description()` to not depend on Perl
The `name_from_description()` test helper uses Perl to munge a given
description and convert it into a name. Refactor it to instead use a
combination of sed(1) and tr(1) so that we drop PERL_TEST_HELPERS
prerequisites in users of this library.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/lib-t6000.sh')
| -rw-r--r-- | t/lib-t6000.sh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/t/lib-t6000.sh b/t/lib-t6000.sh index fba6778ca3..35c5472465 100644 --- a/t/lib-t6000.sh +++ b/t/lib-t6000.sh @@ -109,13 +109,12 @@ check_output () { # All alphanums translated into -'s which are then compressed and stripped # from front and back. name_from_description () { - perl -pe ' - s/[^A-Za-z0-9.]/-/g; - s/-+/-/g; - s/-$//; - s/^-//; - y/A-Z/a-z/; - ' + sed \ + -e 's/[^A-Za-z0-9.]/-/g' \ + -e 's/--*/-/g' \ + -e 's/-$//' \ + -e 's/^-//' \ + -e 'y/A-Z/a-z/' } |
