]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/watch_maildir.t
doc: PublicInbox::SaPlugin::ListMirror manpage
[public-inbox.git] / t / watch_maildir.t
index 7178f29efe029e4815a30d2098790b9a0d07b08a..d164bf35d35d43fedd2bfc4da05606e8f50398ba 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2018 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use Test::More;
 use File::Temp qw/tempdir/;
@@ -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;