Git fork

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>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
de9eeabd 3ca6f205

+6 -19
+6 -7
t/lib-t6000.sh
··· 109 109 # All alphanums translated into -'s which are then compressed and stripped 110 110 # from front and back. 111 111 name_from_description () { 112 - perl -pe ' 113 - s/[^A-Za-z0-9.]/-/g; 114 - s/-+/-/g; 115 - s/-$//; 116 - s/^-//; 117 - y/A-Z/a-z/; 118 - ' 112 + sed \ 113 + -e 's/[^A-Za-z0-9.]/-/g' \ 114 + -e 's/--*/-/g' \ 115 + -e 's/-$//' \ 116 + -e 's/^-//' \ 117 + -e 'y/A-Z/a-z/' 119 118 } 120 119 121 120
-6
t/t6002-rev-list-bisect.sh
··· 7 7 . ./test-lib.sh 8 8 . "$TEST_DIRECTORY"/lib-t6000.sh # t6xxx specific functions 9 9 10 - if ! test_have_prereq PERL_TEST_HELPERS 11 - then 12 - skip_all='skipping rev-list bisect tests; Perl not available' 13 - test_done 14 - fi 15 - 16 10 # usage: test_bisection max-diff bisect-option head ^prune... 17 11 # 18 12 # e.g. test_bisection 1 --bisect l1 ^l0
-6
t/t6003-rev-list-topo-order.sh
··· 8 8 . ./test-lib.sh 9 9 . "$TEST_DIRECTORY"/lib-t6000.sh # t6xxx specific functions 10 10 11 - if ! test_have_prereq PERL_TEST_HELPERS 12 - then 13 - skip_all='skipping rev-list topo-order tests; Perl not available' 14 - test_done 15 - fi 16 - 17 11 list_duplicates() 18 12 { 19 13 "$@" | sort | uniq -d