X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fconfig_limiter.t;h=8c83aca8685c440cb3c69251ac96afa25241e152;hb=80690e594710f2fb89d306f1f5faf4a57aea79c8;hp=85a71257b7544d33e1e138b82e0689c92782f11f;hpb=3d41aa23f35501ca92aab8aa42980fa73f7fa74f;p=public-inbox.git
diff --git a/t/config_limiter.t b/t/config_limiter.t
index 85a71257..8c83aca8 100644
--- a/t/config_limiter.t
+++ b/t/config_limiter.t
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2018 all contributors
+# Copyright (C) 2016-2021 all contributors
# License: AGPL-3.0+
use strict;
use warnings;
@@ -6,11 +6,11 @@ use Test::More;
use PublicInbox::Config;
my $cfgpfx = "publicinbox.test";
{
- my $config = PublicInbox::Config->new({
- "$cfgpfx.address" => 'test@example.com',
- "$cfgpfx.mainrepo" => '/path/to/non/existent',
- "$cfgpfx.httpbackendmax" => 12,
- });
+ my $config = PublicInbox::Config->new(\<lookup_name('test');
my $git = $ibx->git;
my $old = "$git";
@@ -24,21 +24,20 @@ my $cfgpfx = "publicinbox.test";
}
{
- my $config = PublicInbox::Config->new({
- 'publicinboxlimiter.named.max' => 3,
- "$cfgpfx.address" => 'test@example.com',
- "$cfgpfx.mainrepo" => '/path/to/non/existent',
- "$cfgpfx.httpbackendmax" => 'named',
- });
+ my $config = PublicInbox::Config->new(\<lookup_name('test');
my $git = $ibx->git;
ok($git, 'got git object');
- my $old = "$git";
+ my $old = "$git"; # stringify object ref "Git(0xDEADBEEF)"
my $lim = $git->{-httpbackend_limiter};
ok($lim, 'Limiter exists');
is($lim->{max}, 3, 'limiter has expected slots');
$ibx->{git} = undef;
- PublicInbox::Inbox::cleanup_task;
my $new = $ibx->git;
isnt($old, "$new", 'got new Git object');
is("$new->{-httpbackend_limiter}", "$lim", 'same limiter');