From f115168f63c05832d69756723fe9197b03303048 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Jun 2020 10:03:32 +0000 Subject: watchmaildir: fix check for spam vs ham inbox conflicts The old check was ineffective since we process the spam folder config before ham inboxes; and would only fail when attempting to treat the scalar "watchspam" string as an array ref. --- t/watch_maildir.t | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 't') diff --git a/t/watch_maildir.t b/t/watch_maildir.t index 66955072..33a3458b 100644 --- a/t/watch_maildir.t +++ b/t/watch_maildir.t @@ -32,6 +32,21 @@ 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 @w; + local $SIG{__WARN__} = sub { push @w, @_ }; + my $config = PublicInbox::Config->new(\<new($config); + is(scalar grep(/is a spam folder/, @w), 1, 'got warning about spam'); + is_deeply($wm->{mdmap}, { "$spamdir/cur" => 'watchspam' }, + 'only got the spam folder to watch'); +} + my $config = PublicInbox::Config->new(\<