From e6faf9e26bcb172026a4984ecadbaa8b6789bcb7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 4 Feb 2013 12:39:09 +0000 Subject: tests: "wc -l" portability for *BSDs On FreeBSD 9.0, "wc -l" emits leading whitespace, so filter it through tr -d '[:space:]' to eliminate it. --- t/t0045-client_max_header_size.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/t0045-client_max_header_size.sh') diff --git a/t/t0045-client_max_header_size.sh b/t/t0045-client_max_header_size.sh index 17cbc29..cd8f1fe 100755 --- a/t/t0045-client_max_header_size.sh +++ b/t/t0045-client_max_header_size.sh @@ -54,7 +54,7 @@ t_begin "smallest HTTP/0.9 request works right" && { ) | socat - TCP:$listen > $fifo wait test xok = x"$(cat $ok)" - test 1 -eq $(wc -l < $tmp) + test 1 -eq $(count_lines < $tmp) grep HTTP_VERSION $tmp && die "unexpected HTTP_VERSION in HTTP/0.9 request" } @@ -75,7 +75,7 @@ EOF t_begin "HTTP/1.1 request succeeds" && { curl -sSf http://$listen/ > $tmp - test 1 -eq $(wc -l < $tmp) + test 1 -eq $(count_lines < $tmp) dbgcat tmp } -- cgit v1.2.3-24-ge0c7