]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2writable.t
t/search.t t/v2writable.t: Teach search tests to fail more cleanly.
[public-inbox.git] / t / v2writable.t
index d37fb06eae1bdf08582db8ec5771d1841e68a793..b3cdbd3e6c0ff2d336852108ed7aef874e2b0d2b 100644 (file)
@@ -11,6 +11,7 @@ foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
        plan skip_all => "$mod missing for nntpd.t" if $@;
 }
 use_ok 'PublicInbox::V2Writable';
+umask 007;
 my $mainrepo = tempdir('pi-v2writable-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $ibx = {
        mainrepo => $mainrepo,
@@ -36,6 +37,15 @@ my $im = eval {
 };
 is($im->{partitions}, 1, 'one partition when forced');
 ok($im->add($mime), 'ordinary message added');
+foreach my $f ("$mainrepo/msgmap.sqlite3",
+               glob("$mainrepo/xap*/*"),
+               glob("$mainrepo/xap*/*/*")) {
+       my @st = stat($f);
+       my ($bn) = (split(m!/!, $f))[-1];
+       is($st[2] & 07777, -f _ ? 0660 : 0770,
+               "default sharedRepository respected for $bn");
+}
+
 my $git0;
 
 if ('ensure git configs are correct') {
@@ -115,7 +125,7 @@ if ('ensure git configs are correct') {
        my $mset2 = $srch->reopen->query('m:abcde@2', { mset => 1 });
        is($mset2->size, 1, 'message found by second MID');
        is((($mset1->items)[0])->get_docid, (($mset2->items)[0])->get_docid,
-               'same document');
+               'same document') if ($mset1->size);
 }
 
 SKIP: {