Looks like OffsetOnly is not thawed correctly, hence W3CDTF formatter
(for instance) doesn't work with dclone'd object.

use strict;
use warnings;
use DateTime::TimeZone;
use DateTime::Format::W3CDTF;
use Storable;
use Test::More 'no_plan';
use YAML;

{
   my $dt = DateTime->now(time_zone => '+0900');
   my $clone = Storable::dclone($dt);
   my $w3cdtf  = DateTime::Format::W3CDTF->new->format_datetime($dt);
   my $w3cdtf2 =  DateTime::Format::W3CDTF->new->format_datetime($clone);
   is $w3cdtf, $w3cdtf2;
   is Dump($dt), Dump($clone);
}


On 10/25/06, Tatsuhiko Miyagawa <[EMAIL PROTECTED]> wrote:
Looks like this broke t/23storable.t of the current DateTime.

rock:/usr/local/src/CPAN/build/DateTime-0.35# prove -lv t/23storable.t
t/23storable....1..16
Can't use an undefined value as an ARRAY reference at
/usr/local/share/perl/5.8.4/DateTime/TimeZone.pm line 172, at
t/23storable.t line 31
# Looks like your test died before it could output anything.
dubious
       Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED tests 1-16
       Failed 16/16 tests, 0.00% okay
Failed Test    Stat Wstat Total Fail  List of Failed
-------------------------------------------------------------------------------
t/23storable.t  255 65280    16   32  1-16
Failed 1/1 test scripts. 16/16 subtests failed.
Files=1, Tests=16,  0 wallclock secs ( 0.33 cusr +  0.05 csys =  0.38 CPU)
Failed 1/1 test programs. 16/16 subtests failed.



On 10/25/06, Dave Rolsky <[EMAIL PROTECTED]> wrote:
> 0.53     2006-10-24
>
> - Freezing and thawing a DT::TimeZone::OffsetOnly object was broken in
>   0.52 (and probably earlier versions as well). Reported by Tatsuhiko
>   Miyagawa.

I'm sure freezing/thawing of DT::TZ::OffsetOnly was NOT broken in
earlier versions than 0.52, since our app started to break after
upgrading to 0.52.


--
Tatsuhiko Miyagawa



--
Tatsuhiko Miyagawa

Reply via email to