about summary refs log tree commit homepage
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-02-04 12:39:09 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-04 12:39:09 +0000
commit9cd8554749a9f120b010c93933d09d2dd27b1280 (patch)
treecc085e5218ecc342a35420d2bb137dcb42403506 /t/test-lib.sh
parent2a2163594ea2b515e98fbe9f909bcf90e4c35fe8 (diff)
downloadunicorn-9cd8554749a9f120b010c93933d09d2dd27b1280.tar.gz
On FreeBSD 9.0, "wc -l" emits leading whitespace, so
filter it through tr -d '[:space:]' to eliminate it.
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2b93576..28d6a88 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -37,6 +37,11 @@ unix_time () {
         $RUBY -e 'puts Time.now.to_i'
 }
 
+# "wc -l" outputs leading whitespace on *BSDs, filter it out for portability
+count_lines () {
+        wc -l | tr -d '[:space:]'
+}
+
 # "wc -c" outputs leading whitespace on *BSDs, filter it out for portability
 count_bytes () {
         wc -c | tr -d '[:space:]'