diff options
author | Eric Wong <e@yhbt.net> | 2020-04-21 21:16:13 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-04-22 18:26:01 +0000 |
commit | e6b7a7f5f70fb89a54ff158bc6c8b564149947e5 (patch) | |
tree | cd04e08c3f866875586774959fdb64e7e6bb78e8 /t/mid.t | |
parent | 62d1a4da996bd9a664be954f71f78fe052f9df16 (diff) | |
download | public-inbox-e6b7a7f5f70fb89a54ff158bc6c8b564149947e5.tar.gz |
Instead, favor PublicInbox::MIME->new for non-attachment emails. We may support alternatives to Email::MIME down the line. We'll still keep Email::MIME->create to deal with attachments, for now, but there's also a fair amount of test duplication we should eliminate, later.
Diffstat (limited to 't/mid.t')
-rw-r--r-- | t/mid.t | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -2,6 +2,7 @@ # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> use strict; use Test::More; +use PublicInbox::MIME; use PublicInbox::MID qw(mid_escape mids references mids_for_index id_compress); is(mid_escape('foo!@(bar)'), 'foo!@(bar)'); @@ -15,10 +16,8 @@ like(id_compress('foo%bar@wtf'), qr/\A[a-f0-9]{40}\z/, is(id_compress('foobar-wtf'), 'foobar-wtf', 'regular ID not compressed'); { - use Email::MIME; - my $mime = Email::MIME->create; + my $mime = PublicInbox::MIME->new("Message-ID: <mid-1\@a>\n\n"); $mime->header_set('X-Alt-Message-ID', '<alt-id-for-nntp>'); - $mime->header_set('Message-Id', '<mid-1@a>'); is_deeply(['mid-1@a'], mids($mime->header_obj), 'mids in common case'); $mime->header_set('Message-Id', '<mid-1@a>', '<mid-2@b>'); is_deeply(['mid-1@a', 'mid-2@b'], mids($mime->header_obj), '2 mids'); |