In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/792e46564870a460524a90be0cffedd5dcc9e032?hp=c7f317a9270a52c9028667b8adec18e94f450586>
- Log ----------------------------------------------------------------- commit 792e46564870a460524a90be0cffedd5dcc9e032 Author: Ricardo Signes <[email protected]> Date: Wed Apr 15 18:41:10 2015 +0200 corelist: bump test count M dist/Module-CoreList/t/is_core.t commit 4e70aa16a2f45d85bf4bef335d98c6a13e544bcb Author: Ricardo Signes <[email protected]> Date: Wed Apr 15 18:40:36 2015 +0200 cope with versions that do not match x.yyyzzz in corelist Without this, we might be asked about 5.020 but be unable to climb the delta tree because there is no delta entry for 5.020, only for 5.020. This is a poor solution for now, because (for example) some versions are not stored in x.yyyzzz format. One is eveni n x.yyyzz! We should store things in a normalized format, and normalize arguments on input. For now, this will do. M dist/Module-CoreList/lib/Module/CoreList.pm M dist/Module-CoreList/t/is_core.t commit cf549c1a873e982a94bf0869209b000ad6a1bd7a Author: Ricardo Signes <[email protected]> Date: Wed Apr 15 18:24:10 2015 +0200 fix fencepost error in Module::CoreList is_core M dist/Module-CoreList/lib/Module/CoreList.pm M dist/Module-CoreList/t/is_core.t ----------------------------------------------------------------------- Summary of changes: dist/Module-CoreList/lib/Module/CoreList.pm | 6 ++++-- dist/Module-CoreList/t/is_core.t | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dist/Module-CoreList/lib/Module/CoreList.pm b/dist/Module-CoreList/lib/Module/CoreList.pm index 9a041eb..d78d2e6 100644 --- a/dist/Module-CoreList/lib/Module/CoreList.pm +++ b/dist/Module-CoreList/lib/Module/CoreList.pm @@ -11381,7 +11381,7 @@ sub is_core my $final_release = removed_from($module); - return 0 if defined($final_release) && $perl_version > $final_release; + return 0 if defined($final_release) && $perl_version >= $final_release; # If a minimum version of the module was specified: # Step through all perl releases ($prn) @@ -11396,7 +11396,9 @@ sub is_core my @releases = ($perl_version); my $rel = $perl_version; while (defined($rel)) { - $rel = $delta{$rel}->{delta_from}; + # XXX: This line is a sign of failure. -- rjbs, 2015-04-15 + my $this_delta = $delta{$rel} // $delta{ sprintf '%0.6f', $rel }; + $rel = $this_delta->{delta_from}; unshift(@releases, $rel) if defined($rel); } RELEASE: diff --git a/dist/Module-CoreList/t/is_core.t b/dist/Module-CoreList/t/is_core.t index 869aa37..cc06a21 100644 --- a/dist/Module-CoreList/t/is_core.t +++ b/dist/Module-CoreList/t/is_core.t @@ -1,7 +1,7 @@ #!perl -w use strict; use Module::CoreList; -use Test::More tests => 34; +use Test::More tests => 38; BEGIN { require_ok('Module::CoreList'); } @@ -69,3 +69,9 @@ ok(Module::CoreList->is_core('Text::Soundex', '3.03', '5.01'), "5.01 had Text::S ok(Module::CoreList->is_core('DB_File', '1.01', '5.002'), "DB_File 1.01 was included in 5.002"); ok(!Module::CoreList->is_core('DB_File', '1.03', '5.002'), "DB_File 1.03 wasn't included in 5.002"); ok(Module::CoreList->is_core('DB_File', '1.03', '5.00307'), "DB_File 1.03 was included in 5.00307"); + +ok(! Module::CoreList->is_core("CGI", undef, 5.021), "CGI not in 5.021"); +ok(! Module::CoreList->is_core("CGI", undef, 5.021001), "CGI not in 5.021001"); + +ok( Module::CoreList::is_core("Config", 0, "5.020"), "Config v0+ is in core in 5.020"); +ok( Module::CoreList::is_core("Config", undef, "5.020"), "Config v(undef) is in core in 7.020"); -- Perl5 Master Repository
