X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fsearch.t;h=3213ac2a9051a8b7c2b6f929ac2db08c78296646;hb=c29b2b7ded47def906cf00e3baad65c102304120;hp=33a7596e625c681f21364c18443a2dad283bc1f3;hpb=3c313f9034aac96182e2efdc2f92c40803626f32;p=public-inbox.git
diff --git a/t/search.t b/t/search.t
index 33a7596e..3213ac2a 100644
--- a/t/search.t
+++ b/t/search.t
@@ -1,16 +1,12 @@
-# Copyright (C) 2015-2019 all contributors
+# Copyright (C) 2015-2020 all contributors
# License: AGPL-3.0+
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 PublicInbox::SearchIdx;
require PublicInbox::Inbox;
-use PublicInbox::TestCommon;
use Email::MIME;
my ($tmpdir, $for_destroy) = tmpdir();
my $git_dir = "$tmpdir/a.git";
@@ -323,14 +319,14 @@ $ibx->with_umask(sub {
my $mset = $ro->query('t:list@example.com', {mset => 1});
is($mset->size, 6, 'searched To: successfully');
foreach my $m ($mset->items) {
- my $smsg = $ro->lookup_article($m->get_docid);
+ my $smsg = $ro->{over_ro}->get_art($m->get_docid);
like($smsg->to, qr/\blist\@example\.com\b/, 'to appears');
}
$mset = $ro->query('tc:list@example.com', {mset => 1});
is($mset->size, 6, 'searched To+Cc: successfully');
foreach my $m ($mset->items) {
- my $smsg = $ro->lookup_article($m->get_docid);
+ my $smsg = $ro->{over_ro}->get_art($m->get_docid);
my $tocc = join("\n", $smsg->to, $smsg->cc);
like($tocc, qr/\blist\@example\.com\b/, 'tocc appears');
}
@@ -339,7 +335,7 @@ $ibx->with_umask(sub {
my $mset = $ro->query($pfx . 'foo@example.com', { mset => 1 });
is($mset->items, 1, "searched $pfx successfully for Cc:");
foreach my $m ($mset->items) {
- my $smsg = $ro->lookup_article($m->get_docid);
+ my $smsg = $ro->{over_ro}->get_art($m->get_docid);
like($smsg->cc, qr/\bfoo\@example\.com\b/,
'cc appears');
}
@@ -436,15 +432,19 @@ $ibx->with_umask(sub {
}
$rw->unindex_blob($amsg);
$rw->commit_txn_lazy;
- is($ro->lookup_article($art->{num}), undef, 'gone from OVER DB') if defined($art);
+ SKIP: {
+ skip('$art not defined', 1) unless defined $art;
+ is($ro->{over_ro}->get_art($art->{num}), undef,
+ 'gone from OVER DB');
+ };
});
my $all_mask = 07777;
my $dir_mask = 02770;
-# FreeBSD does not allow non-root users to set S_ISGID, so
-# git doesn't set it, either (see DIR_HAS_BSD_GROUP_SEMANTICS in git.git)
-if ($^O =~ /freebsd/i) {
+# FreeBSD and apparently OpenBSD does not allow non-root users to set S_ISGID,
+# so git doesn't set it, either (see DIR_HAS_BSD_GROUP_SEMANTICS in git.git)
+if ($^O =~ /(?:free|open)bsd/i) {
$all_mask = 0777;
$dir_mask = 0770;
}