lei/store: stop shard workers + cat-file on idle
[public-inbox.git] / t / watch_imap.t
blob26fd53302646db1c2a0af380ad944f193ab7d4bf
1 # Copyright (C) all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 use v5.12;
4 use PublicInbox::TestCommon;
5 # see t/imapd*.t for tests against a live IMAP server
7 use_ok 'PublicInbox::Watch';
8 my $tmpdir = tmpdir;
9 my $cfg = cfg_new $tmpdir, <<EOF;
10 [publicinbox "i"]
11         address = i\@example.com
12         inboxdir = /nonexistent
13         watch = imap://example.com/INBOX.a
14 [publicinboxlearn]
15         watchspam = imap://example.com/INBOX.spam
16 EOF
17 my $watch = PublicInbox::Watch->new($cfg);
18 is($watch->{imap}->{'imap://example.com/INBOX.a'}->[0]->{name}, 'i',
19         'watched an inbox');
20 is($watch->{imap}->{'imap://example.com/INBOX.spam'}, 'watchspam',
21         'watched spam folder');
23 done_testing;