t/t0000-simple-http.sh in rainbows-4.4.3 vs t/t0000-simple-http.sh in rainbows-4.5.0
- old
+ new
@@ -58,23 +58,23 @@
) | socat - TCP:$listen > $fifo
}
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' && {
test x"$(cat $ok)" = xok
}
@@ -96,23 +96,23 @@
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" && {
test x"$(cat $ok)" = xok
}
@@ -132,10 +132,10 @@
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" && {
if grep ^Connection: $tmp
then