1 # Copyright (C) 2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
5 use PublicInbox::Config;
6 # see t/imapd*.t for tests against a live IMAP server
8 use_ok 'PublicInbox::Watch';
9 my $cfg = PublicInbox::Config->new(\<<EOF);
10 publicinbox.i.address=i\@example.com
11 publicinbox.i.inboxdir=/nonexistent
12 publicinbox.i.watch=imap://example.com/INBOX.a
13 publicinboxlearn.watchspam=imap://example.com/INBOX.spam
15 my $watch = PublicInbox::Watch->new($cfg);
16 is($watch->{imap}->{'imap://example.com/INBOX.a'}->[0]->{name}, 'i',
18 is($watch->{imap}->{'imap://example.com/INBOX.spam'}, 'watchspam',
19 'watched spam folder');