r2280 - in packages/libtime-piece-perl/trunk: . debian t

Krzysztof Krzyzaniak eloy at costa.debian.org
Tue Mar 7 17:37:39 UTC 2006


Author: eloy
Date: 2006-03-07 17:37:38 +0000 (Tue, 07 Mar 2006)
New Revision: 2280

Added:
   packages/libtime-piece-perl/trunk/._Piece.xs
   packages/libtime-piece-perl/trunk/META.yml
   packages/libtime-piece-perl/trunk/t/06subclass.t
Modified:
   packages/libtime-piece-perl/trunk/Changes
   packages/libtime-piece-perl/trunk/MANIFEST
   packages/libtime-piece-perl/trunk/Piece.pm
   packages/libtime-piece-perl/trunk/Piece.xs
   packages/libtime-piece-perl/trunk/debian/changelog
   packages/libtime-piece-perl/trunk/debian/control
   packages/libtime-piece-perl/trunk/debian/watch
   packages/libtime-piece-perl/trunk/t/01base.t
   packages/libtime-piece-perl/trunk/t/02core.t
   packages/libtime-piece-perl/trunk/t/04mjd.t
Log:
eloy: new upstream version


Copied: packages/libtime-piece-perl/trunk/._Piece.xs (from rev 2279, packages/libtime-piece-perl/branches/upstream/current/._Piece.xs)

Modified: packages/libtime-piece-perl/trunk/Changes
===================================================================
--- packages/libtime-piece-perl/trunk/Changes	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/Changes	2006-03-07 17:37:38 UTC (rev 2280)
@@ -1,6 +1,11 @@
 
 Time::Piece Changes
 
+1.09
+    - (patches from Ricardo SIGNES)
+    - Tests largely moved to Test::More (from Test.pm)
+    - Time::Piece should now be safely subclassable
+
 1.08
     - A number of fixes for strptime
     - Fixed docs wrt Time::Object references

Modified: packages/libtime-piece-perl/trunk/MANIFEST
===================================================================
--- packages/libtime-piece-perl/trunk/MANIFEST	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/MANIFEST	2006-03-07 17:37:38 UTC (rev 2280)
@@ -11,3 +11,5 @@
 t/03compare.t
 t/04mjd.t
 t/05overload.t
+t/06subclass.t
+META.yml                                 Module meta-data (added by MakeMaker)

Copied: packages/libtime-piece-perl/trunk/META.yml (from rev 2279, packages/libtime-piece-perl/branches/upstream/current/META.yml)

Modified: packages/libtime-piece-perl/trunk/Piece.pm
===================================================================
--- packages/libtime-piece-perl/trunk/Piece.pm	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/Piece.pm	2006-03-07 17:37:38 UTC (rev 2280)
@@ -1,4 +1,4 @@
-# $Id: Piece.pm,v 1.16 2002/12/22 11:17:48 matt Exp $
+# $Id: Piece.pm,v 1.16.2.2 2006/02/11 12:55:26 rjbs Exp $
 
 package Time::Piece;
 
@@ -23,7 +23,7 @@
     ':override' => 'internal',
     );
 
-$VERSION = '1.08';
+$VERSION = '1.09';
 
 bootstrap Time::Piece $VERSION;
 
@@ -48,15 +48,19 @@
 use constant 'c_islocal' => 10;
 
 sub localtime {
-    my $time = shift;
+    unshift @_, __PACKAGE__ unless eval { $_[0]->isa('Time::Piece') };
+    my $class = shift;
+    my $time  = shift;
     $time = time if (!defined $time);
-    _mktime($time, 1);
+    $class->_mktime($time, 1);
 }
 
 sub gmtime {
-    my $time = shift;
+    unshift @_, __PACKAGE__ unless eval { $_[0]->isa('Time::Piece') };
+    my $class = shift;
+    my $time  = shift;
     $time = time if (!defined $time);
-    _mktime($time, 0);
+    $class->_mktime($time, 0);
 }
 
 sub new {
@@ -66,13 +70,13 @@
     my $self;
     
     if (defined($time)) {
-        $self = &localtime($time);
+        $self = $class->localtime($time);
     }
     elsif (ref($class) && $class->isa(__PACKAGE__)) {
-        $self = _mktime($class->epoch, $class->[c_islocal]);
+        $self = $class->_mktime($class->epoch, $class->[c_islocal]);
     }
     else {
-        $self = &localtime();
+        $self = $class->localtime();
     }
     
     return bless $self, $class;
@@ -93,18 +97,37 @@
 }
 
 sub _mktime {
-    my ($time, $islocal) = @_;
+    my ($class, $time, $islocal) = @_;
+    $class = eval { (ref $class)->isa('Time::Piece') } ? ref $class : $class;
     if (ref($time)) {
 	$time->[c_epoch] = undef;
-	return wantarray ? @$time : bless [@$time, $islocal], 'Time::Piece';
+	return wantarray ? @$time : bless [@$time, $islocal], $class;
     }
+    _tzset();
     my @time = $islocal ?
             CORE::localtime($time)
                 :
             CORE::gmtime($time);
-    wantarray ? @time : bless [@time, $time, $islocal], 'Time::Piece';
+    wantarray ? @time : bless [@time, $time, $islocal], $class;
 }
 
+my %_special_exports = (
+  localtime => sub { my $c = $_[0]; sub { $c->localtime(@_) } },
+  gmtime    => sub { my $c = $_[0]; sub { $c->gmtime(@_)    } },
+);
+
+sub export {
+  my ($class, $to, @methods) = @_;
+  for my $method (@methods) {
+    if (exists $_special_exports{$method}) {
+      no strict 'refs';
+      *{$to . "::$method"} = $_special_exports{$method}->($class);
+    } else {
+      $class->SUPER::export($to, $method);
+    }
+  }
+}
+
 sub import {
     # replace CORE::GLOBAL localtime and gmtime if required
     my $class = shift;
@@ -332,7 +355,7 @@
 sub julian_day {
     my $time = shift;
     # Correct for localtime
-    $time = &gmtime( $time->epoch ) if $time->[c_islocal];
+    $time = $time->gmtime( $time->epoch ) if $time->[c_islocal];
 
     # Calculate the Julian day itself
     my $jd = $time->_jd( $time->year, $time->mon, $time->mday,
@@ -441,7 +464,7 @@
     my $format = @_ ? shift(@_) : "%a, %d %b %Y %H:%M:%S %Z";
     my @vals = _strptime($string, $format);
 #    warn(sprintf("got vals: %d-%d-%d %d:%d:%d\n", reverse(@vals)));
-    return scalar _mktime(\@vals, (ref($time) ? $time->[c_islocal] : 0));
+    return scalar $time->_mktime(\@vals, (ref($time) ? $time->[c_islocal] : 0));
 }
 
 sub day_list {
@@ -519,7 +542,7 @@
     }
     else {
         # rhs is seconds.
-        return _mktime(($time->epoch - $rhs), $time->[c_islocal]);
+        return $time->_mktime(($time->epoch - $rhs), $time->[c_islocal]);
     }
 }
 
@@ -531,7 +554,7 @@
     }
     croak "Invalid rhs of addition: $rhs" if ref($rhs);
 
-    return _mktime(($time->epoch + $rhs), $time->[c_islocal]);
+    return $time->_mktime(($time->epoch + $rhs), $time->[c_islocal]);
 }
 
 use overload

Modified: packages/libtime-piece-perl/trunk/Piece.xs
===================================================================
--- packages/libtime-piece-perl/trunk/Piece.xs	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/Piece.xs	2006-03-07 17:37:38 UTC (rev 2280)
@@ -875,6 +875,12 @@
     }
 
 void
+_tzset()
+  PPCODE:
+    tzset();
+
+
+void
 _strptime ( string, format )
 	char * string
 	char * format

Modified: packages/libtime-piece-perl/trunk/debian/changelog
===================================================================
--- packages/libtime-piece-perl/trunk/debian/changelog	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/debian/changelog	2006-03-07 17:37:38 UTC (rev 2280)
@@ -1,3 +1,14 @@
+libtime-piece-perl (1.09-1) unstable; urgency=low
+
+  * New upstream release, taking package for Debian Perl Group (closes: #313636)
+  * debian/control:
+   - Uploaders: added me
+   - Maintainers: changed to Debian Perl Group
+   - Standards-Version: increased to 3.6.2 without changes
+  * debian/watch - added 
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org>  Tue,  7 Mar 2006 18:31:39 +0100
+
 libtime-piece-perl (1.08-3) unstable; urgency=low
 
   * New maintainer (closes: #210218)

Modified: packages/libtime-piece-perl/trunk/debian/control
===================================================================
--- packages/libtime-piece-perl/trunk/debian/control	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/debian/control	2006-03-07 17:37:38 UTC (rev 2280)
@@ -1,8 +1,9 @@
 Source: libtime-piece-perl
 Section: perl
 Priority: optional
-Maintainer: Luk Claes <luk.claes at ugent.be>
-Standards-Version: 3.6.1
+Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
+Uploaders: Luk Claes <luk.claes at ugent.be>, Krzysztof Krzyzaniak (eloy) <eloy at debian.org>
+Standards-Version: 3.6.2
 Build-Depends: debhelper (>= 4.1), perl (>= 5.8)
 
 Package: libtime-piece-perl

Modified: packages/libtime-piece-perl/trunk/debian/watch
===================================================================
--- packages/libtime-piece-perl/trunk/debian/watch	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/debian/watch	2006-03-07 17:37:38 UTC (rev 2280)
@@ -1,2 +1,3 @@
 version=2
-http://www.cpan.org/modules/by-category/06_Data_Type_Utilities/Time/Time-Piece-([0-9].*)\.tar\.gz debian uupdate
+http://mirrors.kernel.org/cpan/modules/by-module/Time/Time-Piece-([\d\.]+)\.tar\.gz
+

Modified: packages/libtime-piece-perl/trunk/t/01base.t
===================================================================
--- packages/libtime-piece-perl/trunk/t/01base.t	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/t/01base.t	2006-03-07 17:37:38 UTC (rev 2280)
@@ -1,13 +1,19 @@
-use Test;
-BEGIN { plan tests => 4 }
-use Time::Piece;
-ok(1);
+use Test::More tests => 7;
 
+BEGIN { use_ok('Time::Piece'); }
+
 my $t = gmtime(315532800); # 00:00:00 1/1/1980
 
-ok($t->year == 1980);
+isa_ok($t, 'Time::Piece', 'specific gmtime');
 
-ok($t->hour, 0);
+cmp_ok($t->year, '==', 1980, 'correct year');
 
-ok($t->mon, 1);
+cmp_ok($t->hour, '==',    0, 'correct hour');
 
+cmp_ok($t->mon,  '==',    1, 'correct mon');
+
+my $g = gmtime;
+isa_ok($g, 'Time::Piece', 'current gmtime');
+
+my $l = localtime;
+isa_ok($l, 'Time::Piece', 'current localtime');

Modified: packages/libtime-piece-perl/trunk/t/02core.t
===================================================================
--- packages/libtime-piece-perl/trunk/t/02core.t	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/t/02core.t	2006-03-07 17:37:38 UTC (rev 2280)
@@ -1,53 +1,54 @@
-use Test;
-BEGIN { plan tests => 91 }
+use Test::More tests => 93;
+
 my $is_win32 = ($^O =~ /Win32/);
-use Time::Piece;
+BEGIN { use_ok('Time::Piece'); }
 ok(1);
 
 my $t = gmtime(951827696); # 2000-02-29T12:34:56
 
-ok($t->sec, 56);
-ok($t->second, 56);
-ok($t->min, 34);
-ok($t->minute, 34);
-ok($t->hour, 12);
-ok($t->mday, 29);
-ok($t->day_of_month, 29);
-ok($t->mon, 2);
-ok($t->_mon, 1);
-ok($t->monname, 'Feb');
-ok($t->month, 'Feb');
-ok($t->fullmonth, 'February');
-ok($t->year, 2000);
-ok($t->_year, 100);
-ok($t->yy, '00');
-ok($t->wday == 3);
-ok($t->_wday == 2);
-ok($t->day_of_week == 2);
-ok($t->wdayname eq 'Tue');
-ok($t->day eq 'Tue');
-ok($t->fullday eq 'Tuesday');
-ok($t->yday == 59);
-ok($t->day_of_year == 59);
+is($t->sec,               56);
+is($t->second,            56);
+is($t->min,               34);
+is($t->minute,            34);
+is($t->hour,              12);
+is($t->mday,              29);
+is($t->day_of_month,      29);
+is($t->mon,                2);
+is($t->_mon,               1);
+is($t->monname,        'Feb');
+is($t->month,          'Feb');
+is($t->fullmonth, 'February');
+is($t->year,            2000);
+is($t->_year,            100);
+is($t->yy,              '00');
 
+cmp_ok($t->wday,        '==',         3);
+cmp_ok($t->_wday,       '==',         2);
+cmp_ok($t->day_of_week, '==',         2);
+cmp_ok($t->wdayname,    'eq',     'Tue');
+cmp_ok($t->day,         'eq',     'Tue');
+cmp_ok($t->fullday,     'eq', 'Tuesday');
+cmp_ok($t->yday,        '==',        59);
+cmp_ok($t->day_of_year, '==',        59);
+
 # In GMT there should be no daylight savings ever.
-ok($t->isdst == 0);
-ok($t->daylight_savings == 0);
-ok($t->hms eq '12:34:56');
-ok($t->time eq '12:34:56');
-ok($t->ymd eq '2000-02-29');
-ok($t->date eq '2000-02-29');
-ok($t->mdy eq '02-29-2000');
-ok($t->dmy eq '29-02-2000');
-ok($t->cdate eq 'Tue Feb 29 12:34:56 2000');
-ok("$t" eq 'Tue Feb 29 12:34:56 2000');
-ok($t->datetime eq '2000-02-29T12:34:56');
-ok($t->epoch == 951827696);
+cmp_ok($t->isdst, '==', 0);
+cmp_ok($t->epoch, '==', 951827696);
+cmp_ok($t->hms,   'eq',   '12:34:56');
+cmp_ok($t->time,  'eq',   '12:34:56');
+cmp_ok($t->ymd,   'eq', '2000-02-29');
+cmp_ok($t->date,  'eq', '2000-02-29');
+cmp_ok($t->mdy,   'eq', '02-29-2000');
+cmp_ok($t->dmy,   'eq', '29-02-2000');
+cmp_ok($t->cdate, 'eq', 'Tue Feb 29 12:34:56 2000');
+cmp_ok("$t",      'eq', 'Tue Feb 29 12:34:56 2000');
+cmp_ok($t->datetime, 'eq','2000-02-29T12:34:56');
+cmp_ok($t->daylight_savings, '==', 0);
 
 # ->tzoffset?
-ok(($t->julian_day / 2451604.0243) - 1 < 0.001);
-ok(($t->mjd        /   51603.52426) - 1 < 0.001);
-ok($t->week == 9);
+cmp_ok(($t->julian_day / 2451604.0243 ) - 1, '<', 0.001);
+cmp_ok(($t->mjd        /   51603.52426) - 1, '<', 0.001);
+cmp_ok($t->week, '==', 9);
 
 # strftime tests
 
@@ -56,57 +57,72 @@
 # %C is unportable: sometimes its like asctime(3) or date(1),
 # sometimes it's the century (and whether for 2000 the century is
 # 20 or 19, is fun, too..as far as I can read SUSv2 it should be 20.)
-ok($t->strftime('%d') == 29);
-skip($is_win32, $t->strftime('%D') eq '02/29/00'); # Yech!
-skip($is_win32, $t->strftime('%e') eq '29'); # should test with < 10
-ok($t->strftime('%H') eq '12'); # should test with < 10
+cmp_ok($t->strftime('%d'), '==', 29);
 
- # %h is locale-dependent
+SKIP: {
+  skip "can't strftime %D, %R, %T or %e on Win32", 2 if $is_win32;
+  cmp_ok($t->strftime('%D'), 'eq', '02/29/00'); # Yech!
+  cmp_ok($t->strftime('%e'), 'eq', '29');       # should test with < 10
+}
 
-ok($t->strftime('%I') eq '12'); # should test with < 10
-ok($t->strftime('%j') == 60); # why ->yday+1 ?
-ok($t->strftime('%M') eq '34'); # should test with < 10
+# %h is locale-dependent
+cmp_ok($t->strftime('%H'), 'eq', '12'); # should test with < 10
 
+cmp_ok($t->strftime('%I'), 'eq', '12'); # should test with < 10
+cmp_ok($t->strftime('%j'), '==',  60 ); # why ->yday+1 ?
+cmp_ok($t->strftime('%M'), 'eq', '34'); # should test with < 10
+
 # %p, %P, and %r are not widely implemented,
 # and are possibly unportable (am or AM or a.m., and so on)
 
-skip($is_win32, $t->strftime('%R') eq '12:34'); # should test with > 12
+SKIP: {
+  skip "can't strftime %R on Win32", 1 if $is_win32;
+  cmp_ok($t->strftime('%R'), 'eq', '12:34');    # should test with > 12
+}
+
 ok($t->strftime('%S') eq '56'); # should test with < 10
-skip($is_win32, $t->strftime('%T') eq '12:34:56'); # < 12 and > 12
 
+SKIP: {
+  skip "can't strftime %T on Win32", 1 if $is_win32;
+  cmp_ok($t->strftime('%T'), 'eq', '12:34:56'); # < 12 and > 12
+}
+
 # There are bugs in the implementation of %u in many platforms.
 # (e.g. Linux seems to think, despite the man page, that %u
 # 1-based on Sunday...)
 
-ok($t->strftime('%U') eq '09'); # Sun cmp Mon
-# BROKEN ON OSX: ok($t->strftime('%V') eq '09'); # Sun cmp Mon
-ok($t->strftime('%w') == 2);
-ok($t->strftime('%W') eq '09'); # Sun cmp Mon
+cmp_ok($t->strftime('%U'), 'eq', '09'); # Sun cmp Mon
 
+# is this test really broken on Mac OS? -- rjbs, 2006-02-08
+cmp_ok($t->strftime('%V'), 'eq', '09'); # Sun cmp Mon
+
+cmp_ok($t->strftime('%w'), '==', 2);
+cmp_ok($t->strftime('%W'), 'eq', '09'); # Sun cmp Mon
+
 # %x is locale and implementation dependent.
 
-ok($t->strftime('%y') == 0); # should test with 1999
-ok($t->strftime('%Y') eq '2000');
+cmp_ok($t->strftime('%y'), '==', 0); # should test with 1999
+cmp_ok($t->strftime('%Y'), 'eq', '2000');
 
 # %Z is locale and implementation dependent
 # (there is NO standard for timezone names)
-ok($t->date("") eq '20000229');
-ok($t->ymd("") eq '20000229');
-ok($t->mdy("/") eq '02/29/2000');
-ok($t->dmy(".") eq '29.02.2000');
-ok($t->date_separator() eq '-');
+cmp_ok($t->date(""), 'eq', '20000229');
+cmp_ok($t->ymd("") , 'eq', '20000229');
+cmp_ok($t->mdy("/"), 'eq', '02/29/2000');
+cmp_ok($t->dmy("."), 'eq', '29.02.2000');
+cmp_ok($t->date_separator, 'eq', '-');
 
 $t->date_separator("/");
-ok($t->ymd eq '2000/02/29');
-ok($t->date_separator() eq '/');
+cmp_ok($t->date_separator, 'eq', '/');
+cmp_ok($t->ymd,            'eq', '2000/02/29');
 
 $t->date_separator("-");
-ok($t->hms(".") eq '12.34.56');
-ok($t->time_separator() eq ':');
+cmp_ok($t->time_separator, 'eq', ':');
+cmp_ok($t->hms("."),       'eq', '12.34.56');
 
 $t->time_separator(".");
-ok($t->hms eq '12.34.56');
-ok($t->time_separator() eq '.');
+cmp_ok($t->time_separator, 'eq', '.');
+cmp_ok($t->hms,            'eq', '12.34.56');
 
 $t->time_separator(":");
 
@@ -114,37 +130,41 @@
                  perjantai lauantai );
 my @frdays = qw( Dimanche Lundi Merdi Mercredi Jeudi Vendredi Samedi );
 
-ok($t->day(@fidays) eq "tiistai");
+cmp_ok($t->day(@fidays), 'eq', "tiistai");
 my @days = $t->day_list();
 
 $t->day_list(@frdays);
 
-ok($t->day eq "Merdi");
+cmp_ok($t->day, 'eq', "Merdi");
 
 $t->day_list(@days);
 
-ok($t->day eq "Tue");
+cmp_ok($t->day, 'eq', "Tue");
 
 my @months = $t->mon_list();
 
 my @dumonths = qw(januari februari maart april mei juni
                   juli augustus september oktober november december);
 
-ok($t->month(@dumonths) eq "februari");
+cmp_ok($t->month(@dumonths), 'eq', "februari");
 
 $t->mon_list(@dumonths);
 
-ok($t->month eq "februari");
+cmp_ok($t->month, 'eq', "februari");
 
 $t->mon_list(@months);
 
-ok($t->month eq "Feb");
+cmp_ok($t->month, 'eq', "Feb");
 
-ok($t->datetime(date => '/', T => ' ', time => '-') eq "2000/02/29 12-34-56");
+cmp_ok(
+  $t->datetime(date => '/', T => ' ', time => '-'),
+  'eq',
+  "2000/02/29 12-34-56"
+);
 
 ok($t->is_leap_year); # should test more with different dates
 
-ok($t->month_last_day == 29); # test more
+cmp_ok($t->month_last_day, '==', 29); # test more
 
 ok(!Time::Piece::_is_leap_year(1900));
 
@@ -152,23 +172,28 @@
 
 ok(Time::Piece::_is_leap_year(1904));
 
-ok(Time::Piece->strptime("1945", "%Y")->year, 1945, "Year is 1945?");
+cmp_ok(Time::Piece->strptime("1945", "%Y")->year, '==', 1945, "Year is 1945?");
 
-ok(Time::Piece->strptime("13:00", "%H:%M")->hour, 13, "Hour is 13?");
+cmp_ok(Time::Piece->strptime("13:00", "%H:%M")->hour, '==', 13, "Hour is 13?");
 
 # Test week number
 # [from Ilya Martynov]
-ok(Time::Piece->strptime("2002/06/10 0", '%Y/%m/%d %H')->week,24);
-ok(Time::Piece->strptime("2002/06/10 1", '%Y/%m/%d %H')->week,24);
-ok(Time::Piece->strptime("2002/06/10 2", '%Y/%m/%d %H')->week,24);
-ok(Time::Piece->strptime("2002/06/10 12", '%Y/%m/%d %H')->week,24);
-ok(Time::Piece->strptime("2002/06/10 13", '%Y/%m/%d %H')->week,24);
-ok(Time::Piece->strptime("2002/06/10 14", '%Y/%m/%d %H')->week,24);
-ok(Time::Piece->strptime("2002/06/10 23", '%Y/%m/%d %H')->week,24);
+cmp_ok(Time::Piece->strptime("2002/06/10 0", '%Y/%m/%d %H')->week,  '==', 24);
+cmp_ok(Time::Piece->strptime("2002/06/10 1", '%Y/%m/%d %H')->week,  '==', 24);
+cmp_ok(Time::Piece->strptime("2002/06/10 2", '%Y/%m/%d %H')->week,  '==', 24);
+cmp_ok(Time::Piece->strptime("2002/06/10 12", '%Y/%m/%d %H')->week, '==', 24);
+cmp_ok(Time::Piece->strptime("2002/06/10 13", '%Y/%m/%d %H')->week, '==', 24);
+cmp_ok(Time::Piece->strptime("2002/06/10 14", '%Y/%m/%d %H')->week, '==', 24);
+cmp_ok(Time::Piece->strptime("2002/06/10 23", '%Y/%m/%d %H')->week, '==', 24);
 
 # Test that strptime populates all relevant fields
-ok(Time::Piece->strptime("2002/07/10", '%Y/%m/%d')->wday,4);
-ok(Time::Piece->strptime("2002/07/10", '%Y/%m/%d')->day_of_week,3);
-ok(Time::Piece->strptime("2002/12/31", '%Y/%m/%d')->yday,364);
-ok(Time::Piece->strptime("2002/07/10", '%Y/%m/%d')->isdst,0);
-ok(Time::Piece->strptime("2000/02/29 12:34:56", '%Y/%m/%d %H:%M:%S')->epoch,951827696);
+cmp_ok(Time::Piece->strptime("2002/07/10", '%Y/%m/%d')->wday,  '==', 4);
+cmp_ok(Time::Piece->strptime("2002/12/31", '%Y/%m/%d')->yday,  '==', 364);
+cmp_ok(Time::Piece->strptime("2002/07/10", '%Y/%m/%d')->isdst, '==', 0);
+cmp_ok(Time::Piece->strptime("2002/07/10", '%Y/%m/%d')->day_of_week, '==', 3);
+
+cmp_ok(
+  Time::Piece->strptime("2000/02/29 12:34:56", '%Y/%m/%d %H:%M:%S')->epoch,
+  '==',
+  951827696
+);

Modified: packages/libtime-piece-perl/trunk/t/04mjd.t
===================================================================
--- packages/libtime-piece-perl/trunk/t/04mjd.t	2006-03-07 17:31:31 UTC (rev 2279)
+++ packages/libtime-piece-perl/trunk/t/04mjd.t	2006-03-07 17:37:38 UTC (rev 2280)
@@ -12,7 +12,7 @@
           951827696  => '51603.524', # 2000-02-29T12:34:56UT
           1000011    => '40598.574', # 1970-01-12T13:46:51UT
           1021605703 => '52411.140', # 2002-05-17T03:21:43UT
-           1121605703 => '53568.547', # 2005-07-17T13:08:23UT
+          1121605703 => '53568.547', # 2005-07-17T13:08:23UT
           1011590000 => '52295.218', # 2002-01-21T05:13:20UT
           1011605703 => '52295.399', # 2002-01-21T09:35:03
          );

Copied: packages/libtime-piece-perl/trunk/t/06subclass.t (from rev 2279, packages/libtime-piece-perl/branches/upstream/current/t/06subclass.t)




More information about the Pkg-perl-cvs-commits mailing list