]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/config_limiter.t
www: drop --subject from "git send-email" instructions
[public-inbox.git] / t / config_limiter.t
index 9fafceaed5106cecc423f8f3613d8026a5331575..8c83aca8685c440cb3c69251ac96afa25241e152 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 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(\<<EOF);
+$cfgpfx.address=test\@example.com
+$cfgpfx.inboxdir=/path/to/non/existent
+$cfgpfx.httpbackendmax=12
+EOF
        my $ibx = $config->lookup_name('test');
        my $git = $ibx->git;
        my $old = "$git";
@@ -24,16 +24,16 @@ 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(\<<EOF);
+publicinboxlimiter.named.max=3
+$cfgpfx.address=test\@example.com
+$cfgpfx.inboxdir=/path/to/non/existent
+$cfgpfx.httpbackendmax=named
+EOF
        my $ibx = $config->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');