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-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,AWL,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 0F376200A0 for ; Tue, 27 Oct 2020 07:55:01 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 44/52] t/extsearch.t: verify results and xref3 ordering Date: Tue, 27 Oct 2020 07:54:45 +0000 Message-Id: <20201027075453.19163-45-e@80x24.org> In-Reply-To: <20201027075453.19163-1-e@80x24.org> References: <20201027075453.19163-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We want NNTP clients to see consistent Xref: headers to ensure client-side caches don't get confused. --- t/extsearch.t | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/t/extsearch.t b/t/extsearch.t index dfec6b6f..108ffaeb 100644 --- a/t/extsearch.t +++ b/t/extsearch.t @@ -20,7 +20,7 @@ EOF close $fh or BAIL_OUT $!; my $v2addr = 'v2test@example.com'; my $v1addr = 'v1test@example.com'; -ok(run_script([qw(-init -V2 v2test), "$home/v2test", +ok(run_script([qw(-init -V2 v2test --newsgroup v2.example), "$home/v2test", 'http://example.com/v2test', $v2addr ]), 'v2test init'); my $env = { ORIGINAL_RECIPIENT => $v2addr }; open($fh, '<', 't/utf8.eml') or BAIL_OUT("open t/utf8.eml: $!"); @@ -35,4 +35,15 @@ run_script(['-index', "$home/v1test"]) or BAIL_OUT "index $?"; ok(run_script([qw(-eindex --all), "$home/eindex"]), 'eindex init'); +{ + my $es = PublicInbox::ExtSearch->new("$home/eindex"); + my $smsg = $es->over->get_art(1); + ok($smsg, 'got first article'); + is($es->over->get_art(2), undef, 'only one added'); + my $xref3 = $es->over->get_xref3(1); + like($xref3->[0], qr/\A\Qv2.example\E:1:/, 'order preserved 1'); + like($xref3->[1], qr!\A\Q$home/v1test\E:1:!, 'order preserved 2'); + is(scalar(@$xref3), 2, 'only to entries'); +} + done_testing;