diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-02-04 12:39:09 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-02-04 12:39:09 +0000 |
commit | 9cd8554749a9f120b010c93933d09d2dd27b1280 (patch) | |
tree | cc085e5218ecc342a35420d2bb137dcb42403506 /t/test-lib.sh | |
parent | 2a2163594ea2b515e98fbe9f909bcf90e4c35fe8 (diff) | |
download | unicorn-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.sh | 5 |
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:]' |