diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-02-04 12:39:09 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-02-04 13:38:13 +0000 |
commit | e6faf9e26bcb172026a4984ecadbaa8b6789bcb7 (patch) | |
tree | 37d8b44818b1f62b7c285124073c85fa50e202e5 /t/t0402-async-keepalive.sh | |
parent | f4e3bac180ff01256832f98655636f79b52f9d5b (diff) | |
download | rainbows-e6faf9e26bcb172026a4984ecadbaa8b6789bcb7.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/t0402-async-keepalive.sh')
-rw-r--r-- | t/t0402-async-keepalive.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/t/t0402-async-keepalive.sh b/t/t0402-async-keepalive.sh index b5976da..c507100 100644 --- a/t/t0402-async-keepalive.sh +++ b/t/t0402-async-keepalive.sh @@ -39,9 +39,9 @@ t_begin "async.callback supports pipelining" && { t1=$(unix_time) elapsed=$(( $t1 - $t0 )) t_info "elapsed=$elapsed $model.$0 ($t_current)" - test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | wc -l)" - test 3 -eq "$(grep '^Hello ' $tmp | wc -l)" - test 3 -eq "$(grep 'World ' $tmp | wc -l)" + test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | count_lines)" + test 3 -eq "$(grep '^Hello ' $tmp | count_lines)" + test 3 -eq "$(grep 'World ' $tmp | count_lines)" } t_begin "async.callback supports delayed pipelining" && { @@ -59,9 +59,9 @@ t_begin "async.callback supports delayed pipelining" && { t1=$(unix_time) elapsed=$(( $t1 - $t0 )) t_info "elapsed=$elapsed $model.$0 ($t_current)" - test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | wc -l)" - test 3 -eq "$(grep '^Hello ' $tmp | wc -l)" - test 3 -eq "$(grep 'World ' $tmp | wc -l)" + test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | count_lines)" + test 3 -eq "$(grep '^Hello ' $tmp | count_lines)" + test 3 -eq "$(grep 'World ' $tmp | count_lines)" } t_begin "async.callback supports pipelining with delay $DELAY" && { @@ -82,9 +82,9 @@ t_begin "async.callback supports pipelining with delay $DELAY" && { min=$(( $DELAY * 3 )) t_info "elapsed=$elapsed $model.$0 ($t_current) min=$min" test $elapsed -ge $min - test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | wc -l)" - test 3 -eq "$(grep '^Hello ' $tmp | wc -l)" - test 3 -eq "$(grep 'World ' $tmp | wc -l)" + test 3 -eq "$(fgrep 'HTTP/1.1 200 OK' $tmp | count_lines)" + test 3 -eq "$(grep '^Hello ' $tmp | count_lines)" + test 3 -eq "$(grep 'World ' $tmp | count_lines)" } t_begin "async.callback supports keepalive" && { @@ -94,7 +94,7 @@ t_begin "async.callback supports keepalive" && { elapsed=$(( $t1 - $t0 )) t_info "elapsed=$elapsed $model.$0 ($t_current)" cmp $expect $tmp - test 2 -eq "$(fgrep 'Re-using existing connection!' $curl_err |wc -l)" + test 2 -eq "$(fgrep 'Re-using existing connection!' $curl_err |count_lines)" rm -f $curl_err } @@ -108,7 +108,7 @@ t_begin "async.callback supports keepalive with delay $DELAY" && { t_info "elapsed=$elapsed $model.$0 ($t_current) min=$min" test $elapsed -ge $min cmp $expect $tmp - test 2 -eq "$(fgrep 'Re-using existing connection!' $curl_err |wc -l)" + test 2 -eq "$(fgrep 'Re-using existing connection!' $curl_err |count_lines)" rm -f $curl_err } |