about summary refs log tree commit homepage
path: root/t/filter_subjecttag.t
diff options
context:
space:
mode:
Diffstat (limited to 't/filter_subjecttag.t')
-rw-r--r--t/filter_subjecttag.t16
1 files changed, 13 insertions, 3 deletions
diff --git a/t/filter_subjecttag.t b/t/filter_subjecttag.t
index 922499d5..f88fcad5 100644
--- a/t/filter_subjecttag.t
+++ b/t/filter_subjecttag.t
@@ -1,9 +1,9 @@
-# Copyright (C) 2017-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2017-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use warnings;
 use Test::More;
-use Email::MIME;
+use PublicInbox::Eml;
 use_ok 'PublicInbox::Filter::SubjectTag';
 
 my $f = eval { PublicInbox::Filter::SubjectTag->new };
@@ -11,7 +11,7 @@ like($@, qr/tag not defined/, 'error without args');
 $f = PublicInbox::Filter::SubjectTag->new('-tag', '[foo]');
 is(ref $f, 'PublicInbox::Filter::SubjectTag', 'new object created');
 
-my $mime = Email::MIME->new(<<EOF);
+my $mime = PublicInbox::Eml->new(<<EOF);
 To: you <you\@example.com>
 Subject: =?UTF-8?B?UmU6IFtmb29dIEVsw4PCqWFub3I=?=
 
@@ -24,4 +24,14 @@ $mime->header_str_set('Subject', '[FOO] bar');
 $mime = $f->delivery($mime);
 is($mime->header('Subject'), 'bar', 'filtered non-reply');
 
+$f = PublicInbox::Filter::SubjectTag->new(-tag => '[sox-devel]');
+my $eml = PublicInbox::Eml->new(<<EOF);
+Subject: Re: [SoX-devel] =?utf-8?b?xaE?=
+
+EOF
+$eml = $f->delivery($eml);
+my $s = $eml->header('Subject');
+utf8::encode($s); # to octets
+is($s, "Re: \xc5\xa1", 'subject filtered correctly');
+
 done_testing();