Mercurial > hg > nginx-tests
changeset 647:4e36550410b3
Tests: h2.t fixes for older perl versions, and gzip test.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 17 Aug 2015 17:15:44 +0300 |
parents | 843a74ff43bc |
children | 2f1b10b3ff61 |
files | h2.t |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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); } }