user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH] t/edit: use eml_load here, too
Date: Wed, 20 May 2020 04:46:07 +0000	[thread overview]
Message-ID: <20200520044607.23399-1-e@yhbt.net> (raw)

I missed this instance of file slurping into an Email::MIME-like
object the other week when tearing Email::MIME usage out.
---
 t/edit.t | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/t/edit.t b/t/edit.t
index 1a5698f6..4b004c1c 100644
--- a/t/edit.t
+++ b/t/edit.t
@@ -24,11 +24,9 @@ my $ibx = PublicInbox::Inbox->new({
 $ibx = PublicInbox::InboxWritable->new($ibx, {nproc=>1});
 my $cfgfile = "$tmpdir/config";
 local $ENV{PI_CONFIG} = $cfgfile;
-my $file = 't/data/0001.patch';
-open my $fh, '<', $file or die "open: $!";
-my $raw = do { local $/; <$fh> };
 my $im = $ibx->importer(0);
-my $mime = PublicInbox::Eml->new($raw);
+my $file = 't/data/0001.patch';
+my $mime = eml_load($file);
 my $mid = mid_clean($mime->header('Message-Id'));
 ok($im->add($mime), 'add message to be edited');
 $im->done;

                 reply	other threads:[~2020-05-20  4:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200520044607.23399-1-e@yhbt.net \
    --to=e@yhbt.net \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).