about summary refs log tree commit homepage
path: root/t/msg_iter.t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-25 05:52:22 +0000
committerEric Wong <e@yhbt.net>2020-04-26 07:03:14 +0000
commite39585ee2bdcbeaab7b6bd33b3568021042d0879 (patch)
treeb130b0ce73d8ce9624424c4de6999481ab96439d /t/msg_iter.t
parent5d8dbb4aca5afcc6b98a4d951f03003fb7eaf356 (diff)
downloadpublic-inbox-e39585ee2bdcbeaab7b6bd33b3568021042d0879.tar.gz
tests: remove Email::MIME->create use entirely
Replace them with .eml files generated with the help of
Email::MIME, but without some extraneous and unnecessary
headers, and strip mime_load down to just loading files.

This will give us more freedom to experiment with other mail
libraries which may be more correct, better maintained, use
less memory and/or be faster than Email::MIME.
Diffstat (limited to 't/msg_iter.t')
-rw-r--r--t/msg_iter.t17
1 files changed, 2 insertions, 15 deletions
diff --git a/t/msg_iter.t b/t/msg_iter.t
index ac2066a2..6adbf165 100644
--- a/t/msg_iter.t
+++ b/t/msg_iter.t
@@ -9,12 +9,7 @@ use PublicInbox::InboxWritable;
 use_ok('PublicInbox::MsgIter');
 
 {
-        my $mime = mime_load 't/msg_iter-order.eml', sub {
-        my $parts = [ Email::MIME->create(body => "a\n"),
-                        Email::MIME->create(body => "b\n") ];
-        Email::MIME->create(parts => $parts,
-                                header_str => [ From => 'root@localhost' ]);
-        }; # mime_load sub
+        my $mime = mime_load 't/msg_iter-order.eml';
         my @parts;
         msg_iter($mime, sub {
                 my ($part, $level, @ex) = @{$_[0]};
@@ -26,15 +21,7 @@ use_ok('PublicInbox::MsgIter');
 }
 
 {
-        my $mime = mime_load 't/msg_iter-nested.eml', sub {
-        my $parts = [ Email::MIME->create(body => 'a'),
-                        Email::MIME->create(body => 'b') ];
-        $parts = [ Email::MIME->create(parts => $parts,
-                                header_str => [ From => 'sub@localhost' ]),
-                        Email::MIME->create(body => 'sig') ];
-        Email::MIME->create(parts => $parts,
-                                header_str => [ From => 'root@localhost' ]);
-        }; # mime_load sub
+        my $mime = mime_load 't/msg_iter-nested.eml';
         my @parts;
         msg_iter($mime, sub {
                 my ($part, $level, @ex) = @{$_[0]};