]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/extsearch.t
t/altid_v2: improve test style
[public-inbox.git] / t / extsearch.t
index 09cbdabee6c4f0962936bcf39a6cf2fe5ea275a1..6cbe52626830d5886054072a594b06c31725c5d0 100644 (file)
@@ -13,8 +13,6 @@ require PublicInbox::Search;
 use_ok 'PublicInbox::ExtSearch';
 use_ok 'PublicInbox::ExtSearchIdx';
 use_ok 'PublicInbox::OverIdx';
-my $sock = tcp_server();
-my $host_port = tcp_host_port($sock);
 my ($home, $for_destroy) = tmpdir();
 local $ENV{HOME} = $home;
 mkdir "$home/.public-inbox" or BAIL_OUT $!;
@@ -125,6 +123,8 @@ EOF
 
 SKIP: {
        require_mods(qw(Net::NNTP), 1);
+       my $sock = tcp_server();
+       my $host_port = tcp_host_port($sock);
        my ($out, $err) = ("$home/nntpd.out.log", "$home/nntpd.err.log");
        my $cmd = [ '-nntpd', '-W0', "--stdout=$out", "--stderr=$err" ];
        my $td = start_script($cmd, undef, { 3 => $sock });
@@ -314,7 +314,12 @@ if ('reindex catches missed messages') {
        is($new->{subject}, $eml->header('Subject'), 'new message added');
 
        $es->{xdb}->reopen;
-       my $mset = $es->mset("mid:$new->{mid}");
+       # git patch-id --stable <t/data/0001.patch | awk '{print $1}'
+       my $patchid = '91ee6b761fc7f47cad9f2b09b10489f313eb5b71';
+       my $mset = $es->search->mset("patchid:$patchid");
+       is($mset->size, 1, 'patchid search works');
+
+       $mset = $es->mset("mid:$new->{mid}");
        is($mset->size, 1, 'previously unseen, now indexed in Xapian');
 
        ok($im->remove($eml), 'remove new message from v2 inbox');