From 8a6117a22a7d01eeb5adc63d3152acf435cd3176 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 24 Jan 2013 23:33:54 +0000 Subject: tests: "wc -c" portability for *BSDs On FreeBSD 9.0, "wc -c" emits leading whitespace, so filter it through tr -d '[:space:]' to eliminate it. --- t/test-lib.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 't/test-lib.sh') diff --git a/t/test-lib.sh b/t/test-lib.sh index 8921da6..26709bc 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -43,6 +43,11 @@ unix_time () { $RUBY -e 'puts Time.now.to_i' } +# "wc -c" outputs leading whitespace on *BSDs, filter it out for portability +count_bytes () { + wc -c | tr -d '[:space:]' +} + skip_models () { for i in "$@" do -- cgit v1.2.3-24-ge0c7