Commit | Line | Data |
---|---|---|
2857d2f7 | 1 | #!./perl |
2 | ||
3 | BEGIN { | |
4 | chdir 't' if -d 't'; | |
5 | @INC = '../lib'; | |
2857d2f7 | 6 | |
769448c3 | 7 | require "./test.pl"; |
2857d2f7 | 8 | } |
9 | ||
b9020a0a | 10 | my(@times, @methods); |
11 | BEGIN { | |
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); |
b9020a0a | 13 | @methods = qw(sec min hour mday mon year wday yday isdst); |
14 | ||
15 | plan tests => (@times * @methods) + 1; | |
2857d2f7 | 16 | |
b9020a0a | 17 | use_ok Time::gmtime; |
18 | } | |
2857d2f7 | 19 | |
b9020a0a | 20 | for my $time (@times) { |
769448c3 | 21 | my $gmtime = gmtime $time; # This is the OO gmtime. |
22 | my @gmtime = CORE::gmtime $time; # This is the gmtime function | |
2857d2f7 | 23 | |
b9020a0a | 24 | for my $method (@methods) { |
769448c3 | 25 | is $gmtime->$method, shift @gmtime, "gmtime($time)->$method"; |
26 | } | |
27 | } |