# HG changeset patch # User Sergey Kandaurov # Date 1439820944 -10800 # Node ID 4e36550410b3599dba3dc56f862fa7b0e8988972 # Parent 843a74ff43bc5121a317a96b0319984e38b8bc48 Tests: h2.t fixes for older perl versions, and gzip test. diff --git a/h2.t b/h2.t --- a/h2.t +++ b/h2.t @@ -773,7 +773,7 @@ is($frame->{data}, 'second', 'virtual ho is($frame->{headers}->{'content-encoding'}, 'gzip', 'gzip - encoding'); ($frame) = grep { $_->{type} eq "DATA" } @$frames; -is(gunzip($frame->{data}), 'SEE-THIS', 'gzip - DATA'); +gunzip_like($frame->{data}, qr/^SEE-THIS\Z/, 'gzip - DATA'); # simple proxy cache test @@ -1904,7 +1904,7 @@ sub hunpack { my ($h, $n, $v) = @_; return $h->{$n} = $v unless exists $h->{$n}; $h->{$n} = [ $h->{$n} ]; - push $h->{$n}, $v; + push @{$h->{$n}}, $v; } while ($skip < $length) { @@ -2236,8 +2236,8 @@ sub dehuff { ############################################################################### -sub gunzip { - my ($in) = @_; +sub gunzip_like { + my ($in, $re, $name) = @_; SKIP: { eval { require IO::Uncompress::Gunzip; }; @@ -2248,7 +2248,7 @@ sub gunzip { IO::Uncompress::Gunzip::gunzip(\$in => \$out); - return $out; + like($out, $re, $name); } }