X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fhttpd-corner.t;h=514672a1b2aadaacd48e9f5f61f2f69d589bcdff;hb=933fce93167eba8645e637c363561575db9f9420;hp=7a6bcc6696116c0f352fe89794cb63ac7e1b69ce;hpb=4bebfa0c80ad7f4596a7dca98b39121470a42af0;p=public-inbox.git diff --git a/t/httpd-corner.t b/t/httpd-corner.t index 7a6bcc66..514672a1 100644 --- a/t/httpd-corner.t +++ b/t/httpd-corner.t @@ -296,7 +296,7 @@ my $len = length $str; is($len, 26, 'got the alphabet'); my $check_self = sub { my ($conn) = @_; - vec(my $rbits, fileno($conn), 1) = 1; + vec(my $rbits = '', fileno($conn), 1) = 1; select($rbits, undef, undef, 30) or Carp::confess('timed out'); $conn->read(my $buf, 4096); my ($head, $body) = split(/\r\n\r\n/, $buf, 2); @@ -340,11 +340,18 @@ SKIP: { is($n, 30 * 1024 * 1024, 'got expected output from curl'); is($non_zero, 0, 'read all zeros'); - require_mods(@zmods, 2); + require_mods(@zmods, 4); my $buf = xqx([$curl, '-sS', "$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), + "$base/psgi-return-compressible"], undef, $curl_rdr); + is($?, 0, 'curl --compressed successful'); + is($buf, "goodbye world\n", 'gzipped response as expected'); + like($curl_err, qr/\bContent-Encoding: gzip\b/, + 'curl got gzipped response'); } {