about summary refs log tree commit homepage
path: root/t/config_limiter.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-10-15 00:38:06 +0000
committerEric Wong <e@80x24.org>2019-10-15 20:26:41 +0000
commit1317fb7b4ace03f6d9dfb1a42ee5f9371a1bf913 (patch)
treef46b2e82a2edd849b3ded014bb4b209e778e6a2f /t/config_limiter.t
parent53a8e32b97985803e9de12c4312a86a8850208b3 (diff)
downloadpublic-inbox-1317fb7b4ace03f6d9dfb1a42ee5f9371a1bf913.tar.gz
Rewrite a bunch of tests to use ordered input (emulating
"git config -l" output) so we can always walk sections in
the order they were given in the config file.
Diffstat (limited to 't/config_limiter.t')
-rw-r--r--t/config_limiter.t24
1 files changed, 12 insertions, 12 deletions
diff --git a/t/config_limiter.t b/t/config_limiter.t
index 9fafceae..c1fffecf 100644
--- a/t/config_limiter.t
+++ b/t/config_limiter.t
@@ -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.mainrepo=/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.mainrepo=/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');