]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/config.t
config: do not nest multi-value altid arrays
[public-inbox.git] / t / config.t
index dc448cdffff6b7f92574a4a7903323ccd9e769b3..073d1d03074db83d6054e11991910ccee7d1b66d 100644 (file)
@@ -30,6 +30,7 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
                'url' => 'http://example.com/meta',
                -primary_address => 'meta@public-inbox.org',
                'name' => 'meta',
+               -pi_config => $cfg,
        }, "lookup matches expected output");
 
        is($cfg->lookup('blah@example.com'), undef,
@@ -45,7 +46,21 @@ my $tmpdir = tempdir('pi-config-XXXXXX', TMPDIR => 1, CLEANUP => 1);
                'domain' => 'public-inbox.org',
                'name' => 'test',
                'url' => 'http://example.com/test',
+               -pi_config => $cfg,
        }, "lookup matches expected output for test");
 }
 
+
+{
+       my $cfgpfx = "publicinbox.test";
+       my @altid = qw(serial:gmane:file=a serial:enamg:file=b);
+       my $config = PublicInbox::Config->new({
+               "$cfgpfx.address" => 'test@example.com',
+               "$cfgpfx.mainrepo" => '/path/to/non/existent',
+               "$cfgpfx.altid" => [ @altid ],
+       });
+       my $ibx = $config->lookup_name('test');
+       is_deeply($ibx->{altid}, [ @altid ]);
+}
+
 done_testing();