]> Sergey Matveev's repositories - public-inbox.git/blob - t/watch_imap.t
No ext_urls
[public-inbox.git] / t / watch_imap.t
1 # Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 use strict;
4 use Test::More;
5 use PublicInbox::Config;
6 # see t/imapd*.t for tests against a live IMAP server
7
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
14 EOF
15 my $watch = PublicInbox::Watch->new($cfg);
16 is($watch->{imap}->{'imap://example.com/INBOX.a'}->[0]->{name}, 'i',
17         'watched an inbox');
18 is($watch->{imap}->{'imap://example.com/INBOX.spam'}, 'watchspam',
19         'watched spam folder');
20
21 done_testing;