summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Etheridge <ether@cpan.org>2016-05-06 13:36:17 -0700
committerSteve Hay <steve.m.hay@googlemail.com>2016-07-16 00:22:10 +0100
commit34ebdad47bcefedf77c92254ba4d59b598e93713 (patch)
tree4cc7625e2a641395496371b32fb3aa528ce29dd0
parent26df37f5c2c75dc481e1dc3103957a001d32f130 (diff)
downloadperl-34ebdad47bcefedf77c92254ba4d59b598e93713.tar.gz
fix Module::CoreList::is_core bounds checking for specific module versions
(cherry picked from commit 6af6e5991eb39394eeb1779d27a71f12c051a122)
-rw-r--r--dist/Module-CoreList/Changes6
-rw-r--r--dist/Module-CoreList/lib/Module/CoreList.pm2
-rw-r--r--dist/Module-CoreList/t/is_core.t9
3 files changed, 14 insertions, 3 deletions
diff --git a/dist/Module-CoreList/Changes b/dist/Module-CoreList/Changes
index b254182a07..0c20e2c159 100644
--- a/dist/Module-CoreList/Changes
+++ b/dist/Module-CoreList/Changes
@@ -1,8 +1,12 @@
+
+ - fixed edge-case checking in is_core() (checking for a specific version of
+ a module returned false for the first perl release that contained it)
+
5.20160429
- Updated for v5.22.2
5.20160320
- - Updated vor v5.23.9
+ - Updated for v5.23.9
5.20160228
- [perl #127624] corelist: wrong Digest::SHA version in 5.18.4
diff --git a/dist/Module-CoreList/lib/Module/CoreList.pm b/dist/Module-CoreList/lib/Module/CoreList.pm
index fa2399bfba..6e87ee4f7f 100644
--- a/dist/Module-CoreList/lib/Module/CoreList.pm
+++ b/dist/Module-CoreList/lib/Module/CoreList.pm
@@ -12478,7 +12478,7 @@ sub is_core
}
RELEASE:
foreach my $prn (@releases) {
- next RELEASE if $prn <= $first_release;
+ next RELEASE if $prn < $first_release;
last RELEASE if $prn > $perl_version;
next unless defined(my $next_module_version
= $delta{$prn}->{changed}->{$module});
diff --git a/dist/Module-CoreList/t/is_core.t b/dist/Module-CoreList/t/is_core.t
index cc06a21831..1ddc260348 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 => 38;
+use Test::More tests => 43;
BEGIN { require_ok('Module::CoreList'); }
@@ -28,6 +28,13 @@ ok(Module::CoreList::is_core('attributes', undef, '5.006001') == 1, "attributes
ok(Module::CoreList::is_core('Pod::Plainer', undef, '5.012001') == 1, "Pod::Plainer was core in 5.12.1");
ok(Module::CoreList::is_core('Pod::Plainer', undef, '5.016003') == 0, "Pod::Plainer was removed in 5.13.1");
+ok(!Module::CoreList::is_core('File::Temp', 0, '5.006'), 'File::Temp is not in 5.006000');
+ok(Module::CoreList::is_core('File::Temp', 0, '5.006001'), 'File::Temp is in 5.006001');
+ok(!Module::CoreList::is_core('File::Temp', '0.12', '5.006'), 'File::Temp 0.12 is not in 5.006000');
+ok(Module::CoreList::is_core('File::Temp', '0.12', '5.006001'), 'File::Temp 0.12 is in 5.006001');
+ok(Module::CoreList::is_core('File::Temp', '0.12', '5.006002'), 'File::Temp 0.12 is in 5.006002');
+
+
# history of module 'encoding' in core
# version 1.00 included in 5.007003
# version 1.35 included in 5.008