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');
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;