1#!./perl
2
3use Test::More;
4
5my(@times, @methods);
6BEGIN {
7    @times   = (-2**55, -2**50, -2**33, -2**31-1, -1, 0, 1, 2**31-1, 2**33, 2**50, 2**55, time);
8    @methods = qw(sec min hour mday mon year wday yday isdst);
9
10    use_ok Time::gmtime;
11}
12
13for my $time (@times) {
14    my $gmtime = gmtime $time;          # This is the OO gmtime.
15    my @gmtime = CORE::gmtime $time;    # This is the gmtime function
16
17    is @gmtime, 9, "gmtime($time)";
18    for my $method (@methods) {
19        is $gmtime->$method, shift @gmtime, "gmtime($time)->$method";
20    }
21}
22
23done_testing();
24