From b316f7541ec263fd04ea50530a1d500f43773299 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 25 Dec 2019 07:51:03 +0000 Subject: solvergit: allow passing arg to user-supplied callback This allows us to get rid of the requirement to capture on-stack variables with an anonymous sub, as illustrated with the update to viewvcs to take advantage of this. v2: fix error handling for missing OIDs --- t/solver_git.t | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't') diff --git a/t/solver_git.t b/t/solver_git.t index af5bf7bc..0c272d77 100644 --- a/t/solver_git.t +++ b/t/solver_git.t @@ -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) { -- cgit v1.2.3-24-ge0c7