- my $in = $reply->as_string;
- run_with_env({PATH => $main_path}, [$mda], \$in);
- local $ENV{GIT_DIR} = $maindir;
- my $rev = `git rev-list HEAD`;
- like($rev, qr/\A[a-f0-9]{40}/, "good revision committed");
- }
-
-}
-
-# obvious failures, first
-{
- local $ENV{HOME} = $home;
- my $res = cgi_run("/", "", "PUT");
- like($res->{head}, qr/Status:\s*405/i, "PUT not allowed");
-
- $res = cgi_run("/");
- like($res->{head}, qr/Status:\s*404/i, "index returns 404");
-}
-
-# dumb HTTP support
-{
- my $path = "/test/info/refs";
- my $res = cgi_run($path);
- like($res->{head}, qr/Status:\s*200/i, "info/refs readable");
- my $orig = $res->{body};
-
- local $ENV{HTTP_RANGE} = 'bytes=5-10';
- $res = cgi_run($path);
- like($res->{head}, qr/Status:\s*206/i, "info/refs partial OK");
- is($res->{body}, substr($orig, 5, 6), 'partial body OK');
-
- local $ENV{HTTP_RANGE} = 'bytes=5-';
- $res = cgi_run($path);
- like($res->{head}, qr/Status:\s*206/i, "info/refs partial past end OK");
- is($res->{body}, substr($orig, 5), 'partial body OK past end');
-}
-
-# atom feeds
-{
- local $ENV{HOME} = $home;
- my $res = cgi_run("/test/atom.xml");
- like($res->{body}, qr/<title>test for public-inbox/,
- "set title in XML feed");
- like($res->{body},
- qr!http://test\.example\.com/test/blah%40example\.com/!,
- "link id set");
- like($res->{body}, qr/what\?/, "reply included");
-}
-
-# indices
-{
- local $ENV{HOME} = $home;
- my $res = cgi_run("/test/");
- like($res->{head}, qr/Status: 200 OK/, "index returns 200");
-
- my $idx = cgi_run("/test/index.html");
- $idx->{body} =~ s!/index.html(\?r=)!/$1!g; # dirty...
- $idx->{body} = [ split(/\n/, $idx->{body}) ];
- $res->{body} = [ split(/\n/, $res->{body}) ];
- is_deeply($res, $idx,
- '/$LISTNAME/ and /$LISTNAME/index.html are nearly identical');
- # more checks in t/feed.t
-}
-
-# message-id pages
-{
- local $ENV{HOME} = $home;
- my $slashy_mid = 'slashy/asdf@example.com';
- my $reply = Email::Simple->new(<<EOF);