]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/watch_maildir.t
Merge remote-tracking branch 'origin/manifest' into next
[public-inbox.git] / t / watch_maildir.t
index 7178f29efe029e4815a30d2098790b9a0d07b08a..b85ddc580a69b6f6a1121941fb4d23be3156bc96 100644 (file)
@@ -124,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;