about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-01-05 02:33:05 +0000
committerEric Wong <e@80x24.org>2019-01-05 08:32:59 +0000
commita89d459a1e21181fdf185ee6b3b55a6afcc87b44 (patch)
treef2ca3158306188a9a3f0f628b5642f41da663255 /t
parentbf1943106eef4fe708dddf9245d9be9b85b25f24 (diff)
downloadpublic-inbox-a89d459a1e21181fdf185ee6b3b55a6afcc87b44.tar.gz
Remove redundant slashes while we're at it.
Diffstat (limited to 't')
-rw-r--r--t/watch_maildir.t9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/watch_maildir.t b/t/watch_maildir.t
index 7178f29e..b85ddc58 100644
--- a/t/watch_maildir.t
+++ b/t/watch_maildir.t
@@ -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;