]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/search.t
update copyrights for 2021
[public-inbox.git] / t / search.t
index e789b81ec0de80f7df3b998e1932f89fbc8b9939..7495233ed20a881ceb8fa5f9deb077b516ef638a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
@@ -332,23 +332,15 @@ $ibx->with_umask(sub {
                like($smsg->{to}, qr/\blist\@example\.com\b/, 'to appears');
                my $doc = $m->get_document;
                my $col = PublicInbox::Search::BYTES();
-               my $bytes = PublicInbox::SearchIdx::get_val($doc, $col);
+               my $bytes = PublicInbox::Search::int_val($doc, $col);
                like($bytes, qr/\A[0-9]+\z/, '$bytes stored as digit');
                ok($bytes > 0, '$bytes is > 0');
                is($bytes, $smsg->{bytes}, 'bytes Xapian value matches Over');
 
                $col = PublicInbox::Search::UID();
-               my $uid = PublicInbox::SearchIdx::get_val($doc, $col);
+               my $uid = PublicInbox::Search::int_val($doc, $col);
                is($uid, $smsg->{num}, 'UID column matches {num}');
                is($uid, $m->get_docid, 'UID column matches docid');
-
-               # check ->xref3 for external index:
-               is_deeply($smsg->xref3($doc), [], 'xref3 empty by default');
-               my $exp = "inbox.com.example:$uid:deadbeef";
-               $doc->add_boolean_term('P'.$exp);
-               is_deeply($smsg->xref3($doc), [ $exp ], 'xref3 can be set');
-               $doc->remove_term('P'.$exp);
-               is_deeply($smsg->xref3($doc), [], 'xref3 can be unset');
        }
 
        $mset = $ibx->search->mset('tc:list@example.com');
@@ -521,13 +513,8 @@ $ibx->with_umask(sub {
        $rw_commit->();
        my $doc_id = $rw->add_message(eml_load('t/data/message_embed.eml'));
        ok($doc_id > 0, 'messages within messages');
-
-       my $eml = PublicInbox::Eml->new(<<EOF);
-List-Id: <blahblah.example.com>
-
-EOF
-       $rw->add_xref3($doc_id, 1, 'deadbeef', 'newsgroup1.example', $eml);
-       $rw_commit->();
+       $rw->commit_txn_lazy;
+       $ibx->search->reopen;
        my $n_test_eml = $query->('n:test.eml');
        is(scalar(@$n_test_eml), 1, 'got a result');
        my $n_embed2x_eml = $query->('n:embed2x.eml');
@@ -545,15 +532,6 @@ EOF
        is($query->('s:"mail header experiments"')->[0]->{mid},
                '20200418222508.GA13918@dcvr',
                'Subject search reaches inside message/rfc822');
-       is($query->('l:blahblah.example.com')->[0]->{num}, $doc_id,
-               'xref3 List-Id probabilistic works');
-       is($query->('lid:blahblah.example.com')->[0]->{num}, $doc_id,
-               'xref3 List-Id boolean term works');
-       $rw->remove_xref3($doc_id, 'deadbeef', 'newsgroup1.example', $eml);
-       $rw->commit_txn_lazy;
-       $ibx->search->reopen;
-       my $res = $query->('lid:blahblah.example.com');
-       is_deeply($res, [], '->remove_xref3 dropped boolean term');
 });
 
 done_testing();