]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/watch_maildir.t
search: reenable phrase search on non-chert Xapian
[public-inbox.git] / t / watch_maildir.t
index 30e94c1e5786a6dd62c1dc1f9c6259ba52fd5896..b85ddc580a69b6f6a1121941fb4d23be3156bc96 100644 (file)
@@ -31,7 +31,8 @@ Date: Sat, 18 Jun 2016 00:00:00 +0000
 something
 EOF
 PublicInbox::Emergency->new($maildir)->prepare(\$msg);
-ok(POSIX::mkfifo("$maildir/cur/fifo", 0777));
+ok(POSIX::mkfifo("$maildir/cur/fifo", 0777),
+       'create FIFO to ensure we do not get stuck on it :P');
 my $sem = PublicInbox::Emergency->new($spamdir); # create dirs
 
 my $config = PublicInbox::Config->new({
@@ -123,4 +124,13 @@ More majordomo info at  http://vger.kernel.org/majordomo-info.html\n);
        like($$mref, qr/something\n\z/s, 'message scrubbed on import');
 }
 
+sub is_maildir {
+       my ($dir) = @_;
+       PublicInbox::WatchMaildir::is_maildir($dir);
+}
+
+is(is_maildir('maildir:/hello//world'), '/hello/world', 'extra slash gone');
+is(is_maildir('maildir:/hello/world/'), '/hello/world', 'trailing slash gone');
+is(is_maildir('faildir:/hello/world/'), undef, 'non-maildir rejected');
+
 done_testing;