Skip to content

Commit 4df4313

Browse files
committed
test-lib-functions.sh: rewrite test_seq without Perl
Rewrite the 'seq' imitation using only commands and features that are typically found built into modern POSIX shells, instead of relying on Perl to run a single-liner script. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55672a3 commit 4df4313

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

t/test-lib-functions.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,12 @@ test_seq () {
679679
2) ;;
680680
*) error "bug in the test script: not 1 or 2 parameters to test_seq" ;;
681681
esac
682-
perl -le 'print for $ARGV[0]..$ARGV[1]' -- "$@"
682+
test_seq_counter__=$1
683+
while test "$test_seq_counter__" -le "$2"
684+
do
685+
echo "$test_seq_counter__"
686+
test_seq_counter__=$(( $test_seq_counter__ + 1 ))
687+
done
683688
}
684689

685690
# This function can be used to schedule some commands to be run

0 commit comments

Comments
 (0)