X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fhttpd-corner.t;h=7600c2b955f27b067d29328d3843832920b56506;hb=5dbb060037ce3e3a3ba0812baa90c80eeee762af;hp=973cc55df1c6b946576fcf0540b5ba16cfc8e3eb;hpb=c38111d6f3877cf31d28b0a0339d063df0fa58f6;p=public-inbox.git diff --git a/t/httpd-corner.t b/t/httpd-corner.t index 973cc55d..7600c2b9 100644 --- a/t/httpd-corner.t +++ b/t/httpd-corner.t @@ -7,7 +7,7 @@ use strict; use v5.10.1; use PublicInbox::TestCommon; use Time::HiRes qw(gettimeofday tv_interval); use PublicInbox::Spawn qw(spawn popen_rd); require_mods(qw(Plack::Util Plack::Builder HTTP::Date HTTP::Status)); -use Digest::SHA qw(sha1_hex); +use PublicInbox::SHA qw(sha1_hex); use IO::Handle (); use IO::Socket::UNIX; use Fcntl qw(:seek); @@ -320,7 +320,7 @@ sub conn_for { $spawn_httpd->('-W0'); } -sub delay { select(undef, undef, undef, shift || rand(0.02)) } +sub delay { tick(shift || rand(0.02)) } my $str = 'abcdefghijklmnopqrstuvwxyz'; my $len = length $str; @@ -341,7 +341,7 @@ SKIP: { my $url = "$base/sha1"; my ($r, $w); pipe($r, $w) or die "pipe: $!"; - my $cmd = [$curl, qw(--tcp-nodelay -T- -HExpect: -sSN), $url]; + my $cmd = [$curl, qw(--tcp-nodelay -T- -HExpect: -gsSN), $url]; open my $cout, '+>', undef or die; open my $cerr, '>', undef or die; my $rdr = { 0 => $r, 1 => $cout, 2 => $cerr }; @@ -358,7 +358,7 @@ SKIP: { seek($cout, 0, SEEK_SET); is(<$cout>, sha1_hex($str), 'read expected body'); - my $fh = popen_rd([$curl, '-sS', "$base/async-big"]); + my $fh = popen_rd([$curl, '-gsS', "$base/async-big"]); my $n = 0; my $non_zero = 0; while (1) { @@ -372,12 +372,12 @@ SKIP: { is($non_zero, 0, 'read all zeros'); require_mods(@zmods, 4); - my $buf = xqx([$curl, '-sS', "$base/psgi-return-gzip"]); + my $buf = xqx([$curl, '-gsS', "$base/psgi-return-gzip"]); is($?, 0, 'curl succesful'); IO::Uncompress::Gunzip::gunzip(\$buf => \(my $out)); is($out, "hello world\n"); my $curl_rdr = { 2 => \(my $curl_err = '') }; - $buf = xqx([$curl, qw(-sSv --compressed), + $buf = xqx([$curl, qw(-gsSv --compressed), "$base/psgi-return-compressible"], undef, $curl_rdr); is($?, 0, 'curl --compressed successful'); is($buf, "goodbye world\n", 'gzipped response as expected');