+foreach my $f ("$git_dir/public-inbox/msgmap.sqlite3",
+ "$git_dir/public-inbox",
+ glob("$git_dir/public-inbox/xapian*/"),
+ glob("$git_dir/public-inbox/xapian*/*")) {
+ my @st = stat($f);
+ my ($bn) = (split(m!/!, $f))[-1];
+ oct_is($st[2] & $all_mask, -f _ ? 0660 : $dir_mask,
+ "sharedRepository respected for $bn");
+}
+
+$ibx->with_umask(sub {
+ $rw_commit->();
+ my $digits = '10010260936330';
+ my $ua = 'Pine.LNX.4.10';
+ my $mid = "$ua.$digits.2460-100000\@penguin.transmeta.com";
+ is($ibx->search->mset("m:$digits")->size, 0, 'no results yet');
+ my $pine = PublicInbox::Eml->new(<<EOF);
+Subject: blah
+Message-ID: <$mid>
+From: torvalds\@transmeta
+To: list\@example.com
+
+EOF
+ my $x = $rw->add_message($pine);
+ $rw->commit_txn_lazy;
+ $ibx->search->reopen;
+ is($ibx->search->mset("m:$digits")->size, 1,
+ 'searching only digit yielded result');
+
+ my $wild = $digits;
+ for my $i (1..6) {
+ chop($wild);
+ is($ibx->search->mset("m:$wild*")->size, 1,
+ "searching chopped($i) digit yielded result $wild ");
+ }
+ is($ibx->search->mset('m:Pine m:LNX m:10010260936330')->size, 1);
+});
+
+{ # List-Id searching
+ my $found = $query->('lid:i.m.just.bored');
+ is_deeply([ filter_mids($found) ], [ 'root@s' ],
+ 'got expected mid on exact lid: search');
+
+ $found = $query->('lid:just.bored');
+ is_deeply($found, [], 'got nothing on lid: search');
+
+ $found = $query->('lid:*.just.bored');
+ is_deeply($found, [], 'got nothing on lid: search');
+
+ $found = $query->('l:i.m.just.bored');
+ is_deeply([ filter_mids($found) ], [ 'root@s' ],
+ 'probabilistic search works on full List-Id contents');
+
+ $found = $query->('l:just.bored');
+ is_deeply([ filter_mids($found) ], [ 'root@s' ],
+ 'probabilistic search works on partial List-Id contents');
+
+ $found = $query->('lid:mad');
+ is_deeply($found, [], 'no match on phrase with lid:');