]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2reindex.t
t/*.t: reduce dependency on Email::MIME APIs
[public-inbox.git] / t / v2reindex.t
index 7c14117af0514bb1cccff3c3515d17990c776d0f..b97c6498c27b085c029b792392e10c5181b422a3 100644 (file)
@@ -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::MIME->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);