Subject: | Test fails during install |
Hi,
This won't install at the moment because one of the tests causes a crash.
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/DateTime-LazyInit.t .. 1/107 Cannot subtract 0008-08-08T08:08:08 from a DateTime object (DateTime=HASH(0x30ee980)).
Only a DateTime::Duration or DateTime object can be subtracted from a DateTime object. at t/DateTime-LazyInit.t line 122.
# Looks like your test exited with 255 just after 58.
t/DateTime-LazyInit.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
The problem is here where a DateTime::LazyInit object is being substracted from the DateTime object:
diag("Testing subtraction overload") if $verbose;
my $dtd = $dtli[0] - $dtli[1];
isa_ok($dtli[0] => 'DateTime');
isa_ok($dtli[1] => 'DateTime::LazyInit');
isa_ok($dtd => 'DateTime::Duration');
It can be worked around by forcing the object to inflate and changing the isa_ok type check:
diag("Testing subtraction overload") if $verbose;
my $dtd = $dtli[0] - $dtli[1]->inflate;
isa_ok($dtli[0] => 'DateTime');
isa_ok($dtli[1] => 'DateTime');
isa_ok($dtd => 'DateTime::Duration');
but then the behaviour isn't the same as for a pure DateTime object.