]> git.ipfire.org Git - thirdparty/git.git/commitdiff
test-lib-functions.sh: rewrite test_seq without Perl
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 May 2016 19:37:01 +0000 (12:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 May 2016 21:21:57 +0000 (14:21 -0700)
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>
t/test-lib-functions.sh

index 39b815163de123f88c4145d097929f401124f5d6..9734e322223c77c558d6198ab4a7ce56742839fd 100644 (file)
@@ -679,7 +679,12 @@ test_seq () {
        2)      ;;
        *)      error "bug in the test script: not 1 or 2 parameters to test_seq" ;;
        esac
-       perl -le 'print for $ARGV[0]..$ARGV[1]' -- "$@"
+       test_seq_counter__=$1
+       while test "$test_seq_counter__" -le "$2"
+       do
+               echo "$test_seq_counter__"
+               test_seq_counter__=$(( $test_seq_counter__ + 1 ))
+       done
 }
 
 # This function can be used to schedule some commands to be run