X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=xt%2Fgit_async_cmp.t;h=d66b371ff760153d8b2ee5b8b560d734807953b9;hb=refs%2Fheads%2Fmaster;hp=a7a94c2debc3810ffe295e2910c6a7af6d6389a5;hpb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;p=public-inbox.git diff --git a/xt/git_async_cmp.t b/xt/git_async_cmp.t index a7a94c2d..9edc1f37 100644 --- a/xt/git_async_cmp.t +++ b/xt/git_async_cmp.t @@ -1,10 +1,10 @@ #!perl -w -# Copyright (C) 2019-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ use strict; use Test::More; use Benchmark qw(:all); -use Digest::SHA; +use PublicInbox::SHA; use PublicInbox::TestCommon; my $git_dir = $ENV{GIANT_GIT_DIR}; plan 'skip_all' => "GIANT_GIT_DIR not defined for $0" unless defined($git_dir); @@ -20,7 +20,7 @@ my @dig; my $nr = $ENV{NR} || 1; diag "NR=$nr"; my $async = timeit($nr, sub { - my $dig = Digest::SHA->new(1); + my $dig = PublicInbox::SHA->new(1); my $cb = sub { my ($bref) = @_; $dig->add($$bref); @@ -32,12 +32,12 @@ my $async = timeit($nr, sub { $git->cat_async($oid, $cb); } close $cat or die "cat: $?"; - $git->cat_async_wait; + $git->async_wait_all; push @dig, ['async', $dig->hexdigest ]; }); my $sync = timeit($nr, sub { - my $dig = Digest::SHA->new(1); + my $dig = PublicInbox::SHA->new(1); my $cat = $git->popen(@cat); while (<$cat>) { my ($oid, undef, undef) = split(/ /); @@ -51,7 +51,7 @@ my $sync = timeit($nr, sub { ok(scalar(@dig) >= 2, 'got some digests'); my $ref = shift @dig; my $exp = $ref->[1]; -isnt($exp, Digest::SHA->new(1)->hexdigest, 'not empty'); +isnt($exp, PublicInbox::SHA->new(1)->hexdigest, 'not empty'); foreach (@dig) { is($_->[1], $exp, "digest matches $_->[0] <=> $ref->[0]"); }