X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fwww_static.t;h=3281751c5cdb95dc79a40cda2b5f62ddaccf1762;hb=25fb42242320ffb55655d89268ddbb468eab9a6a;hp=5f2e338029423c49b996b0d9f0bce6fb907cc838;hpb=078f637c80cc33c7d29973b95fdc16205ad7bb32;p=public-inbox.git diff --git a/t/www_static.t b/t/www_static.t index 5f2e3380..3281751c 100644 --- a/t/www_static.t +++ b/t/www_static.t @@ -1,4 +1,4 @@ -# Copyright (C) 2019 all contributors +# Copyright (C) 2019-2021 all contributors # License: AGPL-3.0+ use strict; use warnings; @@ -6,7 +6,7 @@ use Test::More; use PublicInbox::TestCommon; my ($tmpdir, $for_destroy) = tmpdir(); my @mods = qw(HTTP::Request::Common Plack::Test URI::Escape); -require_mods(@mods); +require_mods(@mods, 'IO::Uncompress::Gunzip'); use_ok $_ foreach @mods; use_ok 'PublicInbox::WwwStatic'; @@ -91,6 +91,15 @@ test_psgi($app->(autoindex => 1, index => []), sub { $get->header('Accept-Encoding' => 'gzip'); $res = $cb->($get); is($res->content, "hi", 'got compressed on mtime match'); + + $get = GET('/dir/'); + $get->header('Accept-Encoding' => 'gzip'); + $res = $cb->($get); + my $in = $res->content; + my $out = ''; + IO::Uncompress::Gunzip::gunzip(\$in => \$out); + like($out, qr/\A/, 'got HTML start after gunzip'); + like($out, qr{$}, 'got HTML end after gunzip'); }); done_testing();