about summary refs log tree commit homepage
path: root/t/test-lib.sh
diff options
context:
space:
mode:
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:]'