]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/msgtime.t
t/*.t: use Email::MIME->create over PublicInbox::MIME->create
[public-inbox.git] / t / msgtime.t
index 7c95e547d5bf98dcb877737d73a2c32c1339eef3..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',
@@ -106,6 +107,10 @@ is_datestamp('Mon, 14 Apr 2014 07:59:01 -0007', [1397462761, '-0007']);
 
 SKIP: {
        require_mods('Date::Parse', 1);
+       my $now = time;
+       if (join("\0", gmtime($now)) ne join("\0", localtime($now))) {
+               skip('needs TZ=UTC to test zone-less parsing', 1);
+       }
        is_datestamp('Sat, 27 Sep 1997 10:02:32', [875354552, '+0000']);
 }