diff options
author | Michael G. Schwern <schwern@pobox.com> | 2008-09-23 10:50:16 -0700 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-01-03 18:38:18 +0100 |
commit | b9020a0ae3b98b01aa1548eafc93f1236bf49165 (patch) | |
tree | c693c12a079857e1caf408348f26ca8048cd220c /lib/Time | |
parent | 65a38213a55474ae493d2619f0ad5b8a4179b879 (diff) | |
download | perl-b9020a0ae3b98b01aa1548eafc93f1236bf49165.tar.gz |
Fix the test plan on gmtime
Use the new LOCALTIME_MIN/MAX constants.
Use the system gmtime, it'll probably be faster... maybe.
Diffstat (limited to 'lib/Time')
-rw-r--r-- | lib/Time/gmtime.t | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Time/gmtime.t b/lib/Time/gmtime.t index 383eeda73a..1ccd7fb826 100644 --- a/lib/Time/gmtime.t +++ b/lib/Time/gmtime.t @@ -7,16 +7,22 @@ BEGIN { require "./test.pl"; } -BEGIN { plan tests => 37; } +my(@times, @methods); +BEGIN { + @times = (-2**33, -2**31-1, 0, 2**31-1, 2**33, time); + @methods = qw(sec min hour mday mon year wday yday isdst); + + plan tests => (@times * @methods) + 1; -BEGIN { use_ok Time::gmtime; } + use_ok Time::gmtime; +} # Perl has its own gmtime() so it's safe to do negative times. -for my $time (-2**33, -2**31-1, 0, 2**31-1, 2**33, time) { +for my $time (@times) { my $gmtime = gmtime $time; # This is the OO gmtime. my @gmtime = CORE::gmtime $time; # This is the gmtime function - for my $method (qw(sec min hour mday mon year wday yday isdst)) { + for my $method (@methods) { is $gmtime->$method, shift @gmtime, "gmtime($time)->$method"; } } |