]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/xcpdb-reshard.t
linkify: move to_html over from ViewDiff
[public-inbox.git] / t / xcpdb-reshard.t
index 1eae234dc59d52bf34c431fc20871ced602f2e89..9f0034f1581305b5c32ab29f463876385087790a 100644 (file)
@@ -8,6 +8,7 @@ require_mods(qw(DBD::SQLite Search::Xapian));
 require_git('2.6');
 use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
+require PublicInbox::Search;
 
 my $mime = PublicInbox::MIME->create(
        header => [
@@ -61,8 +62,12 @@ for my $R (qw(2 4 1 3 3)) {
        # ensure docids in Xapian match NNTP article numbers
        my $tot = 0;
        my %tmp = %nums;
+       my $XapianDatabase = do {
+               no warnings 'once';
+               $PublicInbox::Search::X{Database};
+       };
        foreach my $d (@new_shards) {
-               my $xdb = Search::Xapian::Database->new($d);
+               my $xdb = $XapianDatabase->new($d);
                $tot += $xdb->get_doccount;
                my $it = $xdb->postlist_begin('');
                my $end = $xdb->postlist_end('');