]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/search.t
xcpdb: support --no-fsync from CLI
[public-inbox.git] / t / search.t
index 82caf9e41c3dc5170514db48f82ac52e9602b54a..299f57c85ee0c505c545310f3ad9afd32bfa42a5 100644 (file)
@@ -21,8 +21,8 @@ ok($@, "exception raised on non-existent DB");
 
 my $rw = PublicInbox::SearchIdx->new($ibx, 1);
 $ibx->with_umask(sub {
-       $rw->_xdb_acquire;
-       $rw->_xdb_release;
+       $rw->idx_acquire;
+       $rw->idx_release;
 });
 $rw = undef;
 my $ro = PublicInbox::Search->new($ibx);
@@ -397,7 +397,9 @@ $ibx->with_umask(sub {
 
 $ibx->with_umask(sub {
        my $amsg = eml_load 't/search-amsg.eml';
-       ok($rw->add_message($amsg), 'added attachment');
+       my $oid = ('0'x40);
+       my $smsg = bless { blob => $oid }, 'PublicInbox::Smsg';
+       ok($rw->add_message($amsg, $smsg), 'added attachment');
        $rw_commit->();
        $ro->reopen;
        my $n = $ro->query('n:attached_fart.txt');
@@ -418,7 +420,8 @@ $ibx->with_umask(sub {
                $art = $ro->{over_ro}->next_by_mid($mid, \$id, \$prev);
                ok($art, 'article exists in OVER DB');
        }
-       $rw->unindex_blob($amsg);
+       $rw->_msgmap_init;
+       $rw->unindex_eml($oid, $amsg);
        $rw->commit_txn_lazy;
        SKIP: {
                skip('$art not defined', 1) unless defined $art;