]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/config.t: test PublicInbox::Git sharing between inboxes
authorEric Wong <e@80x24.org>
Wed, 30 Jan 2019 20:48:53 +0000 (20:48 +0000)
committerEric Wong <e@80x24.org>
Wed, 30 Jan 2019 20:48:53 +0000 (20:48 +0000)
We need to ensure we don't introduce unnecessary processes
and memory usage for mapping multiple inboxes to the same
code repos.

t/config.t

index 7531fd7552aac14d88855e3f163e12d564264ecb..ad738bd34c0d5af3d8fd7825831792d57665b2a1 100644 (file)
@@ -169,4 +169,23 @@ for my $s (@valid) {
        is_deeply(\@result, \@expect);
 }
 
+{
+       my $pfx1 = "publicinbox.test1";
+       my $pfx2 = "publicinbox.test2";
+       my $h = {
+               "$pfx1.address" => 'test@example.com',
+               "$pfx1.mainrepo" => '/path/to/non/existent',
+               "$pfx2.address" => 'foo@example.com',
+               "$pfx2.mainrepo" => '/path/to/foo',
+               "$pfx1.coderepo" => 'project',
+               "$pfx2.coderepo" => 'project',
+               "coderepo.project.dir" => '/path/to/project.git',
+       };
+       my $cfg = PublicInbox::Config->new($h);
+       my $t1 = $cfg->lookup_name('test1');
+       my $t2 = $cfg->lookup_name('test2');
+       is($t1->{-repo_objs}->[0], $t2->{-repo_objs}->[0],
+               'inboxes share ::Git object');
+}
+
 done_testing();