Merge branch 'ab/drop-scripted-rebase'
[gitweb.git] / t / test-lib-functions.sh
index 094c07748aad423bff0eb8d5ff65ddceb3a4f5a6..681c41ba329a90db8c668fde4640025872f1e622 100644 (file)
@@ -120,13 +120,7 @@ remove_cr () {
 # If $1 is 'infinity', output forever or until the receiving pipe stops reading,
 # whichever comes first.
 generate_zero_bytes () {
-       perl -e 'if ($ARGV[0] == "infinity") {
-               while (-1) {
-                       print "\0"
-               }
-       } else {
-               print "\0" x $ARGV[0]
-       }' "$@"
+       test-tool genzeros "$@"
 }
 
 # In some bourne shell implementations, the "unset" builtin returns
@@ -599,6 +593,15 @@ test_dir_is_empty () {
        fi
 }
 
+# Check if the file exists and has a size greater than zero
+test_file_not_empty () {
+       if ! test -s "$1"
+       then
+               echo "'$1' is not a non-empty file."
+               false
+       fi
+}
+
 test_path_is_missing () {
        if test -e "$1"
        then