]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/search.t
public-inbox-compact: new tool for driving xapian-compact
[public-inbox.git] / t / search.t
index a75dc9b57b6897af523f4fc2ec487cfac7b7aa38..ccf0f7463588eb6a68870c5cd67b049588a695b7 100644 (file)
@@ -1,5 +1,5 @@
-# Copyright (C) 2015 all contributors <meta@public-inbox.org>
-# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+# Copyright (C) 2015-2018 all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
 use Test::More;
@@ -89,7 +89,7 @@ sub filter_mids {
 {
        $rw_commit->();
        $ro->reopen;
-       my $found = $ro->lookup_message('<root@s>');
+       my $found = $ro->first_smsg_by_mid('root@s');
        ok($found, "message found");
        is($root_id, $found->{doc_id}, 'doc_id set correctly');
        is($found->mid, 'root@s', 'mid set correctly');
@@ -264,7 +264,7 @@ sub filter_mids {
                ],
                body => "LOOP!\n"));
        ok($doc_id > 0, "doc_id defined with circular reference");
-       my $smsg = $rw->lookup_message('circle@a');
+       my $smsg = $rw->first_smsg_by_mid('circle@a');
        is($smsg->references, '', "no references created");
        my $msg = PublicInbox::SearchMsg->load_doc($smsg->{doc});
        is($s, $msg->subject, 'long subject not rewritten');
@@ -281,7 +281,7 @@ sub filter_mids {
        my $mime = Email::MIME->new($str);
        my $doc_id = $rw->add_message($mime);
        ok($doc_id > 0, 'message indexed doc_id with UTF-8');
-       my $smsg = $rw->lookup_message('testmessage@example.com');
+       my $smsg = $rw->first_smsg_by_mid('testmessage@example.com');
        my $msg = PublicInbox::SearchMsg->load_doc($smsg->{doc});
 
        is($mime->header('Subject'), $msg->subject, 'UTF-8 subject preserved');