X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fsearch.t;h=7495233ed20a881ceb8fa5f9deb077b516ef638a;hb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;hp=e789b81ec0de80f7df3b998e1932f89fbc8b9939;hpb=d42bb8077d6fe78a61458c990989667308ff1dd2;p=public-inbox.git diff --git a/t/search.t b/t/search.t index e789b81e..7495233e 100644 --- a/t/search.t +++ b/t/search.t @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2020 all contributors +# Copyright (C) 2015-2021 all contributors # License: AGPL-3.0+ 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 - $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();