]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2reindex.t
remove most internal Email::MIME usage
[public-inbox.git] / t / v2reindex.t
index 7c14117af0514bb1cccff3c3515d17990c776d0f..f16a0b0d81c341c3da60ffe65c9529eddb5bfd6a 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
+use PublicInbox::Eml;
 use PublicInbox::ContentId qw(content_digest);
 use File::Path qw(remove_tree);
 use PublicInbox::TestCommon;
@@ -18,22 +18,19 @@ my $ibx_config = {
        -primary_address => 'test@example.com',
        indexlevel => 'full',
 };
-my $agpl = eval {
+my $agpl = do {
        open my $fh, '<', 'COPYING' or die "can't open COPYING: $!";
        local $/;
        <$fh>;
 };
-$agpl or die "AGPL or die :P\n";
 my $phrase = q("defending all users' freedom");
-my $mime = PublicInbox::MIME->create(
-       header => [
-               From => 'a@example.com',
-               To => 'test@example.com',
-               Subject => 'this is a subject',
-               Date => 'Fri, 02 Oct 1993 00:00:00 +0000',
-       ],
-       body => $agpl,
-);
+my $mime = PublicInbox::Eml->new(<<'EOF'.$agpl);
+From: a@example.com
+To: test@example.com
+Subject: this is a subject
+Date: Fri, 02 Oct 1993 00:00:00 +0000
+
+EOF
 my $minmax;
 my $msgmap;
 my ($mark1, $mark2, $mark3, $mark4);
@@ -437,7 +434,7 @@ ok(!-d $xap, 'Xapian directories removed again');
        $config{indexlevel} = 'medium';
        my $ibx = PublicInbox::Inbox->new(\%config);
        my $im = PublicInbox::V2Writable->new($ibx);
-       my $m3 = PublicInbox::MIME->new(<<'EOF');
+       my $m3 = PublicInbox::Eml->new(<<'EOF');
 Date: Tue, 24 May 2016 14:34:22 -0700 (PDT)
 Message-Id: <20160524.143422.552507610109476444.d@example.com>
 To: t@example.com
@@ -468,7 +465,7 @@ Somehow we got a message with 3 sets of headers into one
 message, could've been something broken on the archiver side.
 EOF
 
-       my $m1 = PublicInbox::MIME->new(<<'EOF');
+       my $m1 = PublicInbox::Eml->new(<<'EOF');
 From: a@example.com
 To: t@example.com
 Subject: [PATCH 12/13]