]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/solver_git.t
inbox: use PublicInbox::Git::host_prefix_url for base_url
[public-inbox.git] / t / solver_git.t
index af5bf7bc33f86b296066e0df8a9d55c2a4dc91d4..7c5619a7a15d31ebcc95a6ceb005e902bbe2b24f 100644 (file)
@@ -48,7 +48,7 @@ $ibx->{-repo_objs} = [ $git ];
 my $res;
 my $solver = PublicInbox::SolverGit->new($ibx, sub { $res = $_[0] });
 open my $log, '+>>', "$inboxdir/solve.log" or die "open: $!";
-my $psgi_env = { 'psgi.errors' => *STDERR };
+my $psgi_env = { 'psgi.errors' => *STDERR, 'psgi.url_scheme' => 'http' };
 $solver->solve($psgi_env, $log, '69df7d5', {});
 ok($res, 'solved a blob!');
 my $wt_git = $res->[0];
@@ -127,7 +127,7 @@ SKIP: {
        while (my ($label, $size) = each %bin) {
                pipe(my ($rout, $wout)) or die;
                pipe(my ($rin, $win)) or die;
-               my $rdr = { 0 => fileno($rin), 1 => fileno($wout) };
+               my $rdr = { 0 => $rin, 1 => $wout };
                my $pid = spawn($cmd , $env, $rdr);
                $wout = $rin = undef;
                print { $win } ("\0" x $size) or die;
@@ -157,6 +157,7 @@ EOF
        close $cfgfh or die;
        my $cfg = PublicInbox::Config->new($cfgpath);
        my $www = PublicInbox::WWW->new($cfg);
+       my $non_existent = 'ee5e32211bf62ab6531bdf39b84b6920d0b6775a';
        my $client = sub {
                my ($cb) = @_;
                my $res = $cb->(GET("/$name/3435775/s/"));
@@ -165,6 +166,9 @@ EOF
                $res = $cb->(GET("/$name/".('0'x40).'/s/'));
                is($res->code, 404, 'failure with null OID');
 
+               $res = $cb->(GET("/$name/$non_existent/s/"));
+               is($res->code, 404, 'failure with null OID');
+
                $res = $cb->(GET("/$name/$v1_0_0_tag/s/"));
                is($res->code, 200, 'shows commit');
                while (my ($label, $size) = each %bin) {