Subject: | Tests fail if DateTime::Format::DateManip installed |
This looks like the other Mac Bug, but its repeatable, on many OSes.
1. First, install an old copy of DateManip :
cpanm SBECK/Date-Manip-5.56.tar.gz
2. Second, install DateTime::Format::DateManip ( which requires a v5 DateManip and WILL NOT WORK with DateManip 6 )
PERL_DL_NONLAZY=1 /home/kent/perl5/perlbrew/perls/perl-5.18.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/01_basic.t
t/01_basic.t .. 1/28
# Failed test 'use MooseX::Types::DateTimeX;'
# at t/01_basic.t line 14.
# Tried to use 'MooseX::Types::DateTimeX'.
# Error: Bareword "MooseX::Types::DateTime::ButMaintained::DateTime" not allowed while "strict subs" in use at /home/kent/.cpanm/work/1371334251.664474/MooseX-Types-DateTimeX-0.10/blib/lib/MooseX/Types/DateTimeX.pm line 18.
# Bareword "MooseX::Types::DateTime::ButMaintained::Duration" not allowed while "strict subs" in use at /home/kent/.cpanm/work/1371334251.664474/MooseX-Types-DateTimeX-0.10/blib/lib/MooseX/Types/DateTimeX.pm line 24.
# Compilation failed in require at (eval 36) line 2.
# BEGIN failed--compilation aborted at (eval 36) line 2.
Attempt to reload MooseX/Types/DateTimeX.pm aborted.
Compilation failed in require at t/01_basic.t line 40.
BEGIN failed--compilation aborted at t/01_basic.t line 40.
# Looks like you planned 28 tests but ran 1.
# Looks like you failed 1 test of 1 run.
# Looks like your test exited with 255 just after 1.
t/01_basic.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
The problem seems to be that :
> as MooseX::Types::DateTime::ButMaintained::DateTime;
is invalid, as is
> as MooseX::Types::DateTime::ButMaintained::Duration;
Simply quoting these package namespaces remedies the problem, and makes the test pass.
Were there a repository in the release metadata, I would have submitted a patch.
Additonally, you may wish to recode the tests to not use DateTime::Format::DateManip, as that dependency is far less maintained than MooseX::Types::DateTime , in essence, making DateTimeX inherently less maintained than DateTime
I'm not going to get political about it, we just have things in Gentoo that depend on DateTimeX, and as long as that is true, I'll try to fix bugs in it =).