]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/www_listing.t
disambiguate OverIdx and Over by field name
[public-inbox.git] / t / www_listing.t
index 31d76356d886697093a099129fddf22e1b5e50ad..c4511cd1fed11cc46233e24b371b9d5c0f47b7f3 100644 (file)
@@ -35,18 +35,24 @@ like(PublicInbox::WwwListing::fingerprint($bare), qr/\A[a-f0-9]{40}\z/,
 
 sub tiny_test {
        my ($json, $host, $port) = @_;
+       my $tmp;
        my $http = HTTP::Tiny->new;
        my $res = $http->get("http://$host:$port/");
        is($res->{status}, 200, 'got HTML listing');
        like($res->{content}, qr!</html>!si, 'listing looks like HTML');
+
+       $res = $http->get("http://$host:$port/", {'Accept-Encoding'=>'gzip'});
+       is($res->{status}, 200, 'got gzipped HTML listing');
+       IO::Uncompress::Gunzip::gunzip(\(delete $res->{content}) => \$tmp);
+       like($tmp, qr!</html>!si, 'unzipped listing looks like HTML');
+
        $res = $http->get("http://$host:$port/manifest.js.gz");
        is($res->{status}, 200, 'got manifest');
-       my $tmp;
        IO::Uncompress::Gunzip::gunzip(\(delete $res->{content}) => \$tmp);
        unlike($tmp, qr/"modified":\s*"/, 'modified is an integer');
        my $manifest = $json->decode($tmp);
        ok(my $clone = $manifest->{'/alt'}, '/alt in manifest');
-       is($clone->{owner}, 'lorelei', 'owner set');
+       is($clone->{owner}, "lorelei \x{100}", 'owner set');
        is($clone->{reference}, '/bare', 'reference detected');
        is($clone->{description}, "we're all clones", 'description read');
        ok(my $bare = $manifest->{'/bare'}, '/bare in manifest');
@@ -88,7 +94,8 @@ SKIP: {
        open $fh, '>', "$alt/description" or die;
        print $fh "we're all clones\n" or die;
        close $fh or die;
-       is(xsys('git', "--git-dir=$alt", qw(config gitweb.owner lorelei)), 0,
+       is(xsys('git', "--git-dir=$alt", qw(config gitweb.owner),
+               "lorelei \xc4\x80"), 0,
                'set gitweb user');
        ok(unlink("$bare->{git_dir}/description"), 'removed bare/description');
        open $fh, '>', $cfgfile or die;