X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fsolver_git.t;h=d03a6f387a38de5daeae65218aef36c76fb8a1de;hb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;hp=78cc0edde0d29e9ac75bc4958f52bc090acae4ff;hpb=0283273a14e1871955f6a9132f4f3f7884ec8a3f;p=public-inbox.git diff --git a/t/solver_git.t b/t/solver_git.t index 78cc0edd..d03a6f38 100644 --- a/t/solver_git.t +++ b/t/solver_git.t @@ -1,4 +1,4 @@ -# Copyright (C) 2019-2020 all contributors +# Copyright (C) 2019-2021 all contributors # License: AGPL-3.0+ use strict; use warnings; @@ -35,13 +35,14 @@ my $deliver_patch = sub ($) { $deliver_patch->('t/solve/0001-simple-mod.patch'); my $v1_0_0_tag = 'cb7c42b1e15577ed2215356a2bf925aef59cdd8d'; +my $v1_0_0_tag_short = substr($v1_0_0_tag, 0, 16); my $git = PublicInbox::Git->new($git_dir); $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, 'psgi.url_scheme' => 'http', +my $psgi_env = { 'psgi.errors' => \*STDERR, 'psgi.url_scheme' => 'http', 'HTTP_HOST' => 'example.com' }; $solver->solve($psgi_env, $log, '69df7d5', {}); ok($res, 'solved a blob!'); @@ -173,7 +174,9 @@ EOF is($res->code, 404, 'failure with null OID'); $res = $cb->(GET("/$name/$v1_0_0_tag/s/")); - is($res->code, 200, 'shows commit'); + is($res->code, 200, 'shows commit (unabbreviated)'); + $res = $cb->(GET("/$name/$v1_0_0_tag_short/s/")); + is($res->code, 200, 'shows commit (abbreviated)'); while (my ($label, $size) = each %bin) { $res = $cb->(GET("/$name/$oid{$label}/s/")); is($res->code, 200, "$label binary file");