From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4B78C211B5 for ; Thu, 31 Jan 2019 04:27:25 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/5] t/config.t: test PublicInbox::Git sharing between inboxes Date: Thu, 31 Jan 2019 04:27:20 +0000 Message-Id: <20190131042724.2675-2-e@80x24.org> In-Reply-To: <20190131042724.2675-1-e@80x24.org> References: <20190131042724.2675-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/t/config.t b/t/config.t index 7531fd7..ad738bd 100644 --- a/t/config.t +++ b/t/config.t @@ -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(); -- EW