Update from y2038.
[p5sagit/p5-mst-13.2.git] / lib / Time / localtime.t
CommitLineData
2857d2f7 1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
769448c3 6
7 require "./test.pl";
2857d2f7 8}
9
461d5a49 10my(@times, @methods);
2857d2f7 11BEGIN {
461d5a49 12 @times = (-2**62, -2**50, -2**33, -2**31-1, -1, 0, 1, 2**31-1, 2**33, 2**50, 2**62, time);
4c91ace1 13 @methods = qw(sec min hour mday mon year wday yday isdst);
2857d2f7 14
4c91ace1 15 plan tests => (@times * @methods) + 1;
2857d2f7 16
4c91ace1 17 use_ok Time::localtime;
769448c3 18}
2857d2f7 19
4c91ace1 20for my $time (@times) {
769448c3 21 my $localtime = localtime $time; # This is the OO localtime.
22 my @localtime = CORE::localtime $time; # This is the localtime function
2857d2f7 23
4c91ace1 24 for my $method (@methods) {
769448c3 25 is $localtime->$method, shift @localtime, "localtime($time)->$method";
26 }
27}