]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/*.t: use Email::MIME->create over PublicInbox::MIME->create
authorEric Wong <e@yhbt.net>
Tue, 21 Apr 2020 21:16:12 +0000 (21:16 +0000)
committerEric Wong <e@yhbt.net>
Wed, 22 Apr 2020 18:22:40 +0000 (18:22 +0000)
PublicInbox::MIME only supports ->new, and is only different
from Email::MIME for old versions of Email::MIME.  In the
future, PublicInbox::MIME may not be a subclass of Email::MIME
at all.

13 files changed:
t/convert-compact.t
t/import.t
t/indexlevels-mirror.t
t/msgtime.t
t/psgi_v2.t
t/time.t
t/v1-add-remove-add.t
t/v1reindex.t
t/v2-add-remove-add.t
t/v2mda.t
t/v2reindex.t
t/v2writable.t
t/xcpdb-reshard.t

index af16b70143244cba7bf2b1eb2f642d19ef5271e3..376e0f6a8b15709bd15e9411e5660695f5377d0b 100644 (file)
@@ -7,7 +7,7 @@ use PublicInbox::MIME;
 use PublicInbox::Spawn qw(which);
 use PublicInbox::TestCommon;
 require_git(2.6);
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Email::MIME));
 which('xapian-compact') or
        plan skip_all => 'xapian-compact missing for '.__FILE__;
 
@@ -26,7 +26,7 @@ ok(PublicInbox::Import::run_die([qw(git) , "--git-dir=$ibx->{inboxdir}",
        qw(config core.sharedRepository 0644)]), 'set sharedRepository');
 $ibx = PublicInbox::Inbox->new($ibx);
 my $im = PublicInbox::Import->new($ibx->git, undef, undef, $ibx);
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index 79af9846dce1eaed486b124fd03211615841073d..53345b12fb5b6ee54ec0b957028b3c7d9a54fc18 100644 (file)
@@ -10,12 +10,13 @@ use PublicInbox::Spawn qw(spawn);
 use Fcntl qw(:DEFAULT SEEK_SET);
 use File::Temp qw/tempfile/;
 use PublicInbox::TestCommon;
+require_mods(qw(Email::MIME));
 my ($dir, $for_destroy) = tmpdir();
 
 my $git = PublicInbox::Git->new($dir);
 my $im = PublicInbox::Import->new($git, 'testbox', 'test@example');
 $im->init_bare;
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'b@example.com',
index f220030607b21242c0c0e0d6ce9f40fbd976b619..90506e2846fc1aa428403c77d1439686d649672b 100644 (file)
@@ -10,9 +10,9 @@ require PublicInbox::Admin;
 use PublicInbox::TestCommon;
 my $PI_TEST_VERSION = $ENV{PI_TEST_VERSION} || 2;
 require_git('2.6') if $PI_TEST_VERSION == 2;
-require_mods(qw(DBD::SQLite));
+require_mods(qw(DBD::SQLite Email::MIME));
 
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index 3f09fb4ef76ee0a915add8942136f0860c59ad2d..058f38864b9934061360ab717f347725f2e79538 100644 (file)
@@ -6,12 +6,13 @@ use Test::More;
 use PublicInbox::MIME;
 use PublicInbox::MsgTime;
 use PublicInbox::TestCommon;
+require_mods(qw(Email::MIME));
 
 our $received_date = 'Mon, 22 Jan 2007 13:16:24 -0500';
 sub datestamp ($) {
        my ($date) = @_;
        local $SIG{__WARN__} = sub {};  # Suppress warnings
-       my $mime = PublicInbox::MIME->create(
+       my $mime = Email::MIME->create(
                header => [
                        From => 'a@example.com',
                        To => 'b@example.com',
@@ -34,7 +35,7 @@ EOF
 sub timestamp ($) {
        my ($received) = @_;
        local $SIG{__WARN__} = sub {};  # Suppress warnings
-       my $mime = PublicInbox::MIME->create(
+       my $mime = Email::MIME->create(
                header => [
                        From => 'a@example.com',
                        To => 'b@example.com',
index 57017de1afc4e941caa459af9278c758437086a3..bc26a1129364b0543c1e2995c170405a36d53755 100644 (file)
@@ -9,7 +9,7 @@ use PublicInbox::MIME;
 use PublicInbox::Config;
 use PublicInbox::MID qw(mids);
 require_mods(qw(DBD::SQLite Search::Xapian HTTP::Request::Common Plack::Test
-               URI::Escape Plack::Builder));
+               URI::Escape Plack::Builder Email::MIME));
 use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
 use_ok 'PublicInbox::WWW';
 use_ok 'PublicInbox::V2Writable';
@@ -226,11 +226,11 @@ test_psgi(sub { $www->call(@_) }, sub {
        # ensure conflicted attachments can be resolved
        foreach my $body (qw(old new)) {
                my $parts = [
-                       PublicInbox::MIME->create(
+                       Email::MIME->create(
                                attributes => { content_type => 'text/plain' },
                                body => 'blah',
                        ),
-                       PublicInbox::MIME->create(
+                       Email::MIME->create(
                                attributes => {
                                        filename => 'attach.txt',
                                        content_type => 'text/plain',
@@ -238,7 +238,7 @@ test_psgi(sub { $www->call(@_) }, sub {
                                body => $body
                        )
                ];
-               $mime = PublicInbox::MIME->create(
+               $mime = Email::MIME->create(
                        parts => $parts,
                        header_str => [ From => 'root@z',
                                'Message-ID' => '<a@dup>',
index 3cba3bd144c1b06a56a6a1967485f75c33a8fb84..94bf9181061bbce7d8f41a810a0b394e90af20fe 100644 (file)
--- a/t/time.t
+++ b/t/time.t
@@ -3,9 +3,9 @@
 use strict;
 use warnings;
 use Test::More;
-use_ok 'PublicInbox::MIME';
+use_ok 'Email::MIME';
 use PublicInbox::MsgTime qw(msg_datestamp);
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index fdf06a96e764dc98c828dc4aef33da0de0a75ea7..c3a7e77f18b75607801fd1a8e9de875c942c60b7 100644 (file)
@@ -3,10 +3,9 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
 use PublicInbox::Import;
 use PublicInbox::TestCommon;
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Email::MIME));
 require PublicInbox::SearchIdx;
 my ($inboxdir, $for_destroy) = tmpdir();
 my $ibx = {
@@ -15,7 +14,7 @@ my $ibx = {
        -primary_address => 'test@example.com',
 };
 $ibx = PublicInbox::Inbox->new($ibx);
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index 378c8efb469baa852f34e7b58eef1be67424237e..ce3833be35696a8d325bf28540a4f2644870ee7e 100644 (file)
@@ -3,12 +3,11 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
 use PublicInbox::ContentId qw(content_digest);
 use File::Path qw(remove_tree);
 use PublicInbox::TestCommon;
 require_git(2.6);
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Email::MIME));
 use_ok 'PublicInbox::SearchIdx';
 use_ok 'PublicInbox::Import';
 my ($inboxdir, $for_destroy) = tmpdir();
@@ -18,7 +17,7 @@ my $ibx_config = {
        -primary_address => 'test@example.com',
        indexlevel => 'full',
 };
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index 328f5326e36231fd8845b31e233061774d9d6763..ca998334ce1a4510cf440c73e2abd18d4ce522a9 100644 (file)
@@ -3,10 +3,9 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
 use PublicInbox::TestCommon;
 require_git(2.6);
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Email::MIME));
 use_ok 'PublicInbox::V2Writable';
 my ($inboxdir, $for_destroy) = tmpdir();
 my $ibx = {
@@ -16,7 +15,7 @@ my $ibx = {
        -primary_address => 'test@example.com',
 };
 $ibx = PublicInbox::Inbox->new($ibx);
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index e9dcdf44df8eb307506cefddb729f209ce378cd6..94b63310b5a30bab420eb0cb31ef7c6a91ecde89 100644 (file)
--- a/t/v2mda.t
+++ b/t/v2mda.t
@@ -3,14 +3,13 @@
 use strict;
 use warnings;
 use Test::More;
-use PublicInbox::MIME;
 use Fcntl qw(SEEK_SET);
 use Cwd;
 use PublicInbox::TestCommon;
 require_git(2.6);
 
 my $V = 2;
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Email::MIME));
 use_ok 'PublicInbox::V2Writable';
 my ($tmpdir, $for_destroy) = tmpdir();
 my $ibx = {
@@ -18,7 +17,7 @@ my $ibx = {
        name => 'test-v2writable',
        address => [ 'test@example.com' ],
 };
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index b6164ff810febd2936236e7ac2bd42f0d2e3bdc8..7bf6bc2f935f7f3ce9923d4a7b249b62dc5cb640 100644 (file)
@@ -8,7 +8,7 @@ use PublicInbox::ContentId qw(content_digest);
 use File::Path qw(remove_tree);
 use PublicInbox::TestCommon;
 require_git(2.6);
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Email::MIME));
 use_ok 'PublicInbox::V2Writable';
 my ($inboxdir, $for_destroy) = tmpdir();
 my $ibx_config = {
@@ -24,7 +24,7 @@ my $agpl = do {
        <$fh>;
 };
 my $phrase = q("defending all users' freedom");
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index 8897062abfd04a2d8dbf51da5a2a16fc74145628..7e7560b39b19446378c83baa9142809458e2d877 100644 (file)
@@ -8,7 +8,7 @@ use PublicInbox::ContentId qw(content_digest content_id);
 use PublicInbox::TestCommon;
 use Cwd qw(abs_path);
 require_git(2.6);
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Email::MIME));
 local $ENV{HOME} = abs_path('t');
 use_ok 'PublicInbox::V2Writable';
 umask 007;
@@ -20,7 +20,7 @@ my $ibx = {
        -primary_address => 'test@example.com',
 };
 $ibx = PublicInbox::Inbox->new($ibx);
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',
index 58932fc2ae87b8bf54973c07c11f42e7b77811c9..2571329e51ec5e89729aefa72212b2c0b48c4e7b 100644 (file)
@@ -4,13 +4,13 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::TestCommon;
-require_mods(qw(DBD::SQLite Search::Xapian));
+require_mods(qw(DBD::SQLite Search::Xapian Email::MIME));
 require_git('2.6');
 use PublicInbox::MIME;
 use PublicInbox::InboxWritable;
 require PublicInbox::Search;
 
-my $mime = PublicInbox::MIME->create(
+my $mime = Email::MIME->create(
        header => [
                From => 'a@example.com',
                To => 'test@example.com',