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 <gitster@pobox.com>

Junio C Hamano committed May 9, 2016 at 12:37 UTC 4df4313532dae11529c7d635e99d67e45dc7777f
1 file changed +6 -1
t/test-lib-functions.sh
+6 -1
@@ -679,7 +679,12 @@ test_seq () {
679 2) ;;
680 *) error "bug in the test script: not 1 or 2 parameters to test_seq" ;;
681 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
688 }
689
690 # This function can be used to schedule some commands to be run