From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 379CA1F55F for ; Sun, 24 Sep 2023 09:50:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1695549044; bh=uqh1awU5ZGmjgMpA+rvWILSGR2qhn4iAN1BBt66sO7k=; h=Date:From:To:Subject:References:In-Reply-To:From; b=PT+maG9mcoQQTZdM6VW4plQdBXeRfryOa2rXoGXd+3ML4JEyImAEA+L7Um4xEqPLu +XHRTBCVzJGs0+QsiyQlF7uCor8AC2fdtgTnLYbNpkrknTO5fWqZamLvQFlVFwp7Hi 2gkdD2QSk+BX9fAOpRJNZqAX0Nd1yyWCtj30a76c= Date: Sun, 24 Sep 2023 09:50:44 +0000 From: Eric Wong To: meta@public-inbox.org Subject: [SQUASH 7/6] t/config: fix missing coderepo..dir entry Message-ID: <20230924095044.M96800@dcvr> References: <20230924054214.3539091-1-e@80x24.org> <20230924054214.3539091-7-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230924054214.3539091-7-e@80x24.org> List-Id: Eric Wong wrote: > diff --git a/t/config.t b/t/config.t > index 8a27a920..d567abd9 100644 > @@ -226,18 +230,16 @@ for my $s (@valid) { > } > > { > - my $pfx1 = "publicinbox.test1"; > - my $pfx2 = "publicinbox.test2"; > - my $str = < -$pfx1.address=test\@example.com > -$pfx1.inboxdir=/path/to/non/existent > -$pfx2.address=foo\@example.com > -$pfx2.inboxdir=/path/to/foo > -$pfx1.coderepo=project > -$pfx2.coderepo=project > -coderepo.project.dir=/path/to/project.git Oops, I forgot to translate the coderepo.project.dir line :x > + my $cfg = cfg_new $tmpdir, < +[publicinbox "test1"] > + address = test\@example.com > + inboxdir = /path/to/non/existent > + coderepo = project > +[publicinbox "test2"] > + address = foo\@example.com > + inboxdir = /path/to/foo > + coderepo = project > EOF > - my $cfg = PublicInbox::Config->new(\$str); > my $t1 = $cfg->lookup_name('test1'); > my $t2 = $cfg->lookup_name('test2'); > is($cfg->repo_objs($t1)->[0], $cfg->repo_objs($t2)->[0], -----8<---- Subject: [SQUASH] t/config: fix missing coderepo..dir entry Also added an extra check to ensure the coderepo's parsed properly. --- t/config.t | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/config.t b/t/config.t index d567abd9..9b6684b7 100644 --- a/t/config.t +++ b/t/config.t @@ -239,9 +239,12 @@ for my $s (@valid) { address = foo\@example.com inboxdir = /path/to/foo coderepo = project +[coderepo "project"] + dir = /path/to/project.git EOF my $t1 = $cfg->lookup_name('test1'); my $t2 = $cfg->lookup_name('test2'); + ok $cfg->repo_objs($t1)->[0], 'coderepo parsed'; is($cfg->repo_objs($t1)->[0], $cfg->repo_objs($t2)->[0], 'inboxes share ::Git object'); }