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 | ||
769448c3 | 10 | BEGIN { plan tests => 37; } |
2857d2f7 | 11 | |
769448c3 | 12 | BEGIN { use_ok Time::gmtime; } |
2857d2f7 | 13 | |
769448c3 | 14 | for 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 | } |