This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
new perldelta
[perl5.git] / lib / Time / gmtime.t
CommitLineData
2857d2f7
JH
1#!./perl
2
bd3fc147 3use Test::More;
2857d2f7 4
b9020a0a
MS
5my(@times, @methods);
6BEGIN {
fc003d4b 7 @times = (-2**55, -2**50, -2**33, -2**31-1, -1, 0, 1, 2**31-1, 2**33, 2**50, 2**55, time);
b9020a0a
MS
8 @methods = qw(sec min hour mday mon year wday yday isdst);
9
b9020a0a
MS
10 use_ok Time::gmtime;
11}
2857d2f7 12
b9020a0a 13for my $time (@times) {
769448c3
MS
14 my $gmtime = gmtime $time; # This is the OO gmtime.
15 my @gmtime = CORE::gmtime $time; # This is the gmtime function
2857d2f7 16
fc003d4b 17 is @gmtime, 9, "gmtime($time)";
b9020a0a 18 for my $method (@methods) {
769448c3
MS
19 is $gmtime->$method, shift @gmtime, "gmtime($time)->$method";
20 }
21}
70cbce25
MB
22
23done_testing();