Cleaning up the Time::gmtime and Time::localtime tests and make them go past 2038.
[p5sagit/p5-mst-13.2.git] / lib / Time / gmtime.t
CommitLineData
2857d2f7 1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
2857d2f7 6
769448c3 7 require "./test.pl";
2857d2f7 8}
9
769448c3 10BEGIN { plan tests => 37; }
2857d2f7 11
769448c3 12BEGIN { use_ok Time::gmtime; }
2857d2f7 13
769448c3 14for my $time (0, 2**31-1, 2**33, time) {
15 my $gmtime = gmtime $time; # This is the OO gmtime.
16 my @gmtime = CORE::gmtime $time; # This is the gmtime function
2857d2f7 17
769448c3 18 for my $method (qw(sec min hour mday mon year wday yday isdst)) {
19 is $gmtime->$method, shift @gmtime, "gmtime($time)->$method";
20 }
21}