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-18 03:38:46 +0000
committerEric Wong <e@yhbt.net>2020-04-19 08:51:17 +0000
commit0f6b0cac5bf10d036a84dbab732e8991edf56c34 (patch)
tree043acb6313f02f5c3e934cdd48a7730c375defb7 /t/msg_iter.t
parentd0147582e289fdd4cdd84e91d8b0f8ae9c230124 (diff)
downloadpublic-inbox-0f6b0cac5bf10d036a84dbab732e8991edf56c34.tar.gz
There's nothing Maildir-specific about the function, so
`maildir_path_load' was a bad name.  So give it a more
appropriate name and use it in our tests.

This save ourselves some code and inconsistency by reusing an
existing internal library routine in more places.  We can drop
the "From_" line in some of our (formerly) mbox sample files.
Diffstat (limited to 't/msg_iter.t')
-rw-r--r--t/msg_iter.t18
1 files changed, 6 insertions, 12 deletions
diff --git a/t/msg_iter.t b/t/msg_iter.t
index d303564f..573ee412 100644
--- a/t/msg_iter.t
+++ b/t/msg_iter.t
@@ -5,6 +5,7 @@ use warnings;
 use Test::More;
 use Email::MIME;
 use PublicInbox::Hval qw(ascii_html);
+use PublicInbox::InboxWritable;
 use_ok('PublicInbox::MsgIter');
 
 {
@@ -42,12 +43,9 @@ use_ok('PublicInbox::MsgIter');
 }
 
 {
-        my $f = 't/iso-2202-jp.mbox';
-        my $mime = Email::MIME->new(do {
-                open my $fh, '<', $f or die "open($f): $!";
-                local $/;
-                <$fh>;
-        });
+        my $f = 't/iso-2202-jp.eml';
+        my $mime = PublicInbox::InboxWritable::mime_from_path($f) or
+                die "open $f: $!";
         my $raw = '';
         msg_iter($mime, sub {
                 my ($part, $level, @ex) = @{$_[0]};
@@ -61,12 +59,8 @@ use_ok('PublicInbox::MsgIter');
 
 {
         my $f = 't/x-unknown-alpine.eml';
-        my $mime = Email::MIME->new(do {
-                open my $fh, '<', $f or die "open($f): $!";
-                local $/;
-                binmode $fh;
-                <$fh>;
-        });
+        my $mime = PublicInbox::InboxWritable::mime_from_path($f) or
+                die "open $f: $!";
         my $raw = '';
         msg_iter($mime, sub {
                 my ($part, $level, @ex) = @{$_[0]};