about summary refs log tree commit homepage
path: root/t/t0000-simple-http.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-02-04 12:39:09 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-04 13:38:13 +0000
commite6faf9e26bcb172026a4984ecadbaa8b6789bcb7 (patch)
tree37d8b44818b1f62b7c285124073c85fa50e202e5 /t/t0000-simple-http.sh
parentf4e3bac180ff01256832f98655636f79b52f9d5b (diff)
downloadrainbows-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/t0000-simple-http.sh')
-rwxr-xr-xt/t0000-simple-http.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/t0000-simple-http.sh b/t/t0000-simple-http.sh
index 57a7d59..c9481bd 100755
--- a/t/t0000-simple-http.sh
+++ b/t/t0000-simple-http.sh
@@ -60,19 +60,19 @@ t_begin "pipelining partial requests" && {
 dbgcat tmp
 
 t_begin "two HTTP/1.1 responses" && {
-        test 2 -eq $(grep '^HTTP/1.1' $tmp | wc -l)
+        test 2 -eq $(grep '^HTTP/1.1' $tmp | count_lines)
 }
 
 t_begin "two HTTP/1.1 200 OK responses" && {
-        test 2 -eq $(grep '^HTTP/1.1 200 OK' $tmp | wc -l)
+        test 2 -eq $(grep '^HTTP/1.1 200 OK' $tmp | count_lines)
 }
 
 t_begin 'one "Connection: keep-alive" response' && {
-        test 1 -eq $(grep '^Connection: keep-alive' $tmp | wc -l)
+        test 1 -eq $(grep '^Connection: keep-alive' $tmp | count_lines)
 }
 
 t_begin 'one "Connection: close" response' && {
-        test 1 -eq $(grep '^Connection: close' $tmp | wc -l)
+        test 1 -eq $(grep '^Connection: close' $tmp | count_lines)
 }
 
 t_begin 'check subshell success' && {
@@ -98,19 +98,19 @@ dbgcat tmp
 dbgcat r_err
 
 t_begin "got 2 HTTP/1.1 responses from pipelining" && {
-        test 2 -eq $(grep '^HTTP/1.1' $tmp | wc -l)
+        test 2 -eq $(grep '^HTTP/1.1' $tmp | count_lines)
 }
 
 t_begin "got 2 HTTP/1.1 200 OK responses" && {
-        test 2 -eq $(grep '^HTTP/1.1 200 OK' $tmp | wc -l)
+        test 2 -eq $(grep '^HTTP/1.1 200 OK' $tmp | count_lines)
 }
 
 t_begin "one keepalive connection" && {
-        test 1 -eq $(grep '^Connection: keep-alive' $tmp | wc -l)
+        test 1 -eq $(grep '^Connection: keep-alive' $tmp | count_lines)
 }
 
 t_begin "second request closes connection" && {
-        test 1 -eq $(grep '^Connection: close' $tmp | wc -l)
+        test 1 -eq $(grep '^Connection: close' $tmp | count_lines)
 }
 
 t_begin "subshell exited correctly" && {
@@ -134,7 +134,7 @@ dbgcat tmp
 dbgcat r_err
 
 t_begin "env.inspect should've put everything on one line" && {
-        test 1 -eq $(wc -l < $tmp)
+        test 1 -eq $(count_lines < $tmp)
 }
 
 t_begin "no headers in output" && {