Skip Menu |

This queue is for tickets about the Date-Manip CPAN distribution.

Report information
The Basics
Id: 118705
Status: resolved
Priority: 0/
Queue: Date-Manip

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 6.55
Fixed in: (no value)



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 )
 

I didn't really like it myself... I was trying to get an independent way to determine the version so I could test that it was set right in the module. I realize that the only one who actually needs to run that test is me, so I've made it a RELEASE_TESTING test which means it won't be needed elsewhere. The fix will be in the next release (scheduled for the start of December).