1 # Copyright (C) all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
4 use PublicInbox::TestCommon;
7 my $config = cfg_new $tmpdir, <<EOF;
9 address = test\@example.com
10 inboxdir = /path/to/non/existent
13 my $ibx = $config->lookup_name('test');
16 my $lim = $git->{-httpbackend_limiter};
17 ok($lim, 'Limiter exists');
18 is($lim->{max}, 12, 'limiter has expected slots');
21 isnt($old, "$git", 'got new Git object');
22 is("$git->{-httpbackend_limiter}", "$lim", 'same limiter');
26 my $config = cfg_new $tmpdir, <<EOF;
27 [publicinboxlimiter "named"]
30 address = test\@example.com
31 inboxdir = /path/to/non/existent
32 httpbackendmax = named
34 my $ibx = $config->lookup_name('test');
36 ok($git, 'got git object');
37 my $old = "$git"; # stringify object ref "Git(0xDEADBEEF)"
38 my $lim = $git->{-httpbackend_limiter};
39 ok($lim, 'Limiter exists');
40 is($lim->{max}, 3, 'limiter has expected slots');
43 isnt($old, "$new", 'got new Git object');
44 is("$new->{-httpbackend_limiter}", "$lim", 'same limiter');
45 is($lim->{max}, 3, 'limiter has expected slots');