Update from y2038.
[p5sagit/p5-mst-13.2.git] / lib / Time / gmtime.t
index 383eeda..9c77f81 100644 (file)
@@ -7,16 +7,21 @@ BEGIN {
     require "./test.pl";
 }
 
-BEGIN { plan tests => 37; }
+my(@times, @methods);
+BEGIN {
+    @times   = (-2**62, -2**50, -2**33, -2**31-1, -1, 0, 1, 2**31-1, 2**33, 2**50, 2**62, time);
+    @methods = qw(sec min hour mday mon year wday yday isdst);
+
+    plan tests => (@times * @methods) + 1;
 
-BEGIN { use_ok Time::gmtime; }
+    use_ok Time::gmtime;
+}
 
-# Perl has its own gmtime() so it's safe to do negative times.
-for my $time (-2**33, -2**31-1, 0, 2**31-1, 2**33, time) {
+for my $time (@times) {
     my $gmtime = gmtime $time;          # This is the OO gmtime.
     my @gmtime = CORE::gmtime $time;    # This is the gmtime function
 
-    for my $method (qw(sec min hour mday mon year wday yday isdst)) {
+    for my $method (@methods) {
         is $gmtime->$method, shift @gmtime, "gmtime($time)->$method";
     }
 }