X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fxcpdb-reshard.t;h=9f0034f1581305b5c32ab29f463876385087790a;hb=d62d98b9a7f502da65673f0b83a6d06312c060d9;hp=0d78d2b200b3e58136a9d5e997f4de788c114f42;hpb=3c313f9034aac96182e2efdc2f92c40803626f32;p=public-inbox.git diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t index 0d78d2b2..9f0034f1 100644 --- a/t/xcpdb-reshard.t +++ b/t/xcpdb-reshard.t @@ -3,15 +3,12 @@ use strict; use warnings; use Test::More; -my @mods = qw(DBI DBD::SQLite Search::Xapian); -foreach my $mod (@mods) { - eval "require $mod"; - plan skip_all => "missing $mod for $0" if $@; -}; use PublicInbox::TestCommon; +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 => [ @@ -65,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('');