test: replace shebangs with descriptions in shell libraries
[gitweb.git] / t / test-lib-functions.sh
index f98769427b51017db7b9d757fd12e582609dbb03..aeae3ca7699b4c828f8ebe50624b5179fb5098b8 100644 (file)
@@ -1,4 +1,5 @@
-#!/bin/sh
+# Library of functions shared by all tests scripts, included by
+# test-lib.sh.
 #
 # Copyright (c) 2005 Junio C Hamano
 #
@@ -76,11 +77,11 @@ test_decode_color () {
 }
 
 nul_to_q () {
-       "$PERL_PATH" -pe 'y/\000/Q/'
+       perl -pe 'y/\000/Q/'
 }
 
 q_to_nul () {
-       "$PERL_PATH" -pe 'y/Q/\000/'
+       perl -pe 'y/Q/\000/'
 }
 
 q_to_cr () {
@@ -648,7 +649,7 @@ test_seq () {
        2)      ;;
        *)      error "bug in the test script: not 1 or 2 parameters to test_seq" ;;
        esac
-       "$PERL_PATH" -le 'print for $ARGV[0]..$ARGV[1]' -- "$@"
+       perl -le 'print for $ARGV[0]..$ARGV[1]' -- "$@"
 }
 
 # This function can be used to schedule some commands to be run
@@ -711,6 +712,10 @@ test_ln_s_add () {
        fi
 }
 
+perl () {
+       command "$PERL_PATH" "$@"
+}
+
 # The following mingw_* functions obey POSIX shell syntax, but are actually
 # bash scripts, and are meant to be used only with bash on Windows.