Subject: | r/obt.t fails with versions missmatched |
date -R
Fri, 11 Nov 2016 10:18:32 +1300
perl -Mblib -Mlib=lib t/obj.t
not ok 49
# Arguments: [ - version o0001 ]
# Results : [ 6.56 ]
# Expected : [ 6.560.0 ]
not ok 50
# Arguments: [ - version o0001 1 ]
# Results : [ 6.56 ]
# Expected : [ 6.560.0 ]
ok 51
not ok 52
# Arguments: [ - version o0002 ]
# Results : [ 6.56 ]
# Expected : [ 6.560.0 ]
not ok 53
# Arguments: [ - version o0002 1 ]
# Results : [ '6.56 [america/chicago]' ]
# Expected : [ '6.560.0 [america/chicago]' ]
1..53
This is perl 5, version 24, subversion 1 (v5.24.1) built for x86_64-linux
These tests are all getting their version from DM6.pm it seems, which is:
> our ($VERSION);
> $VERSION='6.56';
> END { undef $VERSION; }
Why thats expected to be normalised as 6.560.0 is anybodies guess.
perl -Mblib -Mlib=lib -MDate::Manip -E' say DateManipVersion'
6.56
UUggghhhh. I think I found it.
Its this block of code, it sets "$vers" wrong:
---
use Cwd;
my $dir = getcwd;
$dir =~ /Date-Manip-([0-9.]+)/;
my $vers = $1;
# Travis-CI renames the directory to just Date-Manip (no version) so this
# test cannot be done.
if (! defined $vers) {
$vers = DateManipVersion();
}
---
Adding a << die "$vers" >> in there gives:
/var/tmp/portage/dev-perl/Date-Manip-6.560.0/work/Date-Manip-6.56
Hence, the test code erroneously sees our temporary dir with our *vendor side* naming scheme and *vendor side* version, and that takes precedence over the version in the tar directory.
Extracting the version from the tar-ball directory name is a bit hacky IMO, and it was bound to break eventually.
--
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )