diff options
author | Eric Wong <e@80x24.org> | 2019-01-05 02:33:05 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-01-05 08:32:59 +0000 |
commit | a89d459a1e21181fdf185ee6b3b55a6afcc87b44 (patch) | |
tree | f2ca3158306188a9a3f0f628b5642f41da663255 /t | |
parent | bf1943106eef4fe708dddf9245d9be9b85b25f24 (diff) | |
download | public-inbox-a89d459a1e21181fdf185ee6b3b55a6afcc87b44.tar.gz |
Remove redundant slashes while we're at it.
Diffstat (limited to 't')
-rw-r--r-- | t/watch_maildir.t | 9 |
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; |