From: Craig A. Berry Date: Fri, 27 Mar 2009 14:30:01 +0000 (-0500) Subject: Some standards compliance for the new Time::Piece test. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d82dd1bcff0c4a6fd34a7b7c69185b1d2823307a;p=p5sagit%2Fp5-mst-13.2.git Some standards compliance for the new Time::Piece test. This is a follow-up to 036055ae9ae83cd5b00514419663540cb13fc21a. Setting TZ in the environment may or may not have any effect without calling tzset() afterwards, and the %z format specifier for strftime() is not in the standard (and was causing smoke failures in many places). --- diff --git a/ext/Time-Piece/t/02core.t b/ext/Time-Piece/t/02core.t index fb43038..7c1495d 100644 --- a/ext/Time-Piece/t/02core.t +++ b/ext/Time-Piece/t/02core.t @@ -49,9 +49,10 @@ cmp_ok($t->daylight_savings, '==', 0); # ->tzoffset? { local $ENV{TZ} = "EST"; + Time::Piece::_tzset(); # register the environment change my $lt = localtime; cmp_ok(scalar($lt->tzoffset), 'eq', '-18000'); - cmp_ok($lt->strftime("%z"), 'eq', '-0500'); + cmp_ok($lt->strftime("%Z"), 'eq', 'EST'); } cmp_ok(($t->julian_day / 2451604.0243 ) - 1, '<', 0.001);