]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/nntpd.t
remove most internal Email::MIME usage
[public-inbox.git] / t / nntpd.t
index 2d7280a50d5e8a466c9a36649a916c8603aa293a..69f72ce12163ef453f8171a3494b23b326b7cdf8 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -7,7 +7,7 @@ use PublicInbox::TestCommon;
 use PublicInbox::Spawn qw(which);
 require_mods(qw(DBD::SQLite));
 require PublicInbox::InboxWritable;
-use Email::Simple;
+use PublicInbox::Eml;
 use IO::Socket;
 use Socket qw(IPPROTO_TCP TCP_NODELAY);
 use Net::NNTP;
@@ -57,7 +57,7 @@ $ibx = PublicInbox::Inbox->new($ibx);
 
        # ensure successful message delivery
        {
-               my $mime = Email::MIME->new(<<EOF);
+               my $mime = PublicInbox::Eml->new(<<EOF);
 To: =?utf-8?Q?El=C3=A9anor?= <you\@example.com>
 From: =?utf-8?Q?El=C3=A9anor?= <me\@example.com>
 Cc: $addr
@@ -241,7 +241,7 @@ EOF
                ok($date <= $t1, 'valid date before stop');
        }
        if ('leafnode interop') {
-               my $for_leafnode = PublicInbox::MIME->new(<<"");
+               my $for_leafnode = PublicInbox::Eml->new(<<"");
 From: longheader\@example.com
 To: $addr
 Subject: none
@@ -329,12 +329,12 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
 
        $n = $s = undef;
        $td->join;
-       my $eout = eval {
-               local $/;
+       is($?, 0, 'no error in exited process');
+       my $eout = do {
                open my $fh, '<', $err or die "open $err failed: $!";
+               local $/;
                <$fh>;
        };
-       is($?, 0, 'no error in exited process');
        unlike($eout, qr/wide/i, 'no Wide character warnings');
 }