From b4bc9aeed78078feae58d150970fe224f10098e3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 16 Sep 2021 00:26:51 +0000 Subject: inbox: streamline ->nntp_url We no longer waste a precious hash slot for a per-Inbox {nntpserver} if it's only configured globally for all inboxes. --- t/config.t | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 't') diff --git a/t/config.t b/t/config.t index 877e5d5d..2b02f063 100644 --- a/t/config.t +++ b/t/config.t @@ -43,7 +43,6 @@ my ($tmpdir, $for_destroy) = tmpdir(); -primary_address => 'meta@public-inbox.org', 'name' => 'meta', -httpbackend_limiter => undef, - nntpserver => undef, }, "lookup matches expected output"); is($cfg->lookup('blah@example.com'), undef, @@ -60,7 +59,6 @@ my ($tmpdir, $for_destroy) = tmpdir(); 'name' => 'test', 'url' => [ 'http://example.com/test' ], -httpbackend_limiter => undef, - nntpserver => undef, }, "lookup matches expected output for test"); } @@ -99,20 +97,27 @@ EOF my $str = <new(\$str); my $ibx = $cfg->lookup_name('test'); - is($ibx->{nntpserver}, 'news.example.com', 'global NNTP server'); + is_deeply($ibx->nntp_url({ www => { pi_cfg => $cfg }}), + [ 'nntp://news.example.com/inbox.test' ], + 'nntp_url uses global NNTP server'); $str = <new(\$str); $ibx = $cfg->lookup_name('test'); - is($ibx->{nntpserver}, 'news.alt.example.com','per-inbox NNTP server'); + is_deeply($ibx->nntp_url({ www => { pi_cfg => $cfg }}), + [ 'nntp://news.alt.example.com/inbox.test' ], + 'nntp_url uses per-inbox NNTP server'); } # no obfuscate domains -- cgit v1.2.3-24-ge0c7