1 # Copyright (C) 2016-2020 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
6 use PublicInbox::TestCommon;
7 use_ok 'PublicInbox::Filter::Base';
10 my $f = PublicInbox::Filter::Base->new;
11 ok($f, 'created stock object');
12 ok(defined $f->{reject_suffix}, 'rejected suffix redefined');
13 is(ref($f->{reject_suffix}), 'Regexp', 'reject_suffix should be a RE');
17 my $f = PublicInbox::Filter::Base->new(reject_suffix => undef);
18 ok($f, 'created base object q/o reject_suffix');
19 ok(!defined $f->{reject_suffix}, 'reject_suffix not defined');
23 my $f = PublicInbox::Filter::Base->new;
24 my $email = eml_load 't/filter_base-xhtml.eml';
25 is($f->delivery($email), 100, "xhtml rejected");
29 my $f = PublicInbox::Filter::Base->new;
30 my $email = eml_load 't/filter_base-junk.eml';
31 is($f->delivery($email), 100, 'proprietary format rejected on glob');