Skip to content

Commit 6af6e59

Browse files
karenetheridgekhwilliamson
authored andcommitted
fix Module::CoreList::is_core bounds checking for specific module versions
1 parent ea319c8 commit 6af6e59

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

dist/Module-CoreList/Changes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
2+
- fixed edge-case checking in is_core() (checking for a specific version of
3+
a module returned false for the first perl release that contained it)
4+
15
5.20160429
26
- Updated for v5.22.2
37

48
5.20160320
5-
- Updated vor v5.23.9
9+
- Updated for v5.23.9
610

711
5.20160228
812
- [perl #127624] corelist: wrong Digest::SHA version in 5.18.4

dist/Module-CoreList/lib/Module/CoreList.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12478,7 +12478,7 @@ sub is_core
1247812478
}
1247912479
RELEASE:
1248012480
foreach my $prn (@releases) {
12481-
next RELEASE if $prn <= $first_release;
12481+
next RELEASE if $prn < $first_release;
1248212482
last RELEASE if $prn > $perl_version;
1248312483
next unless defined(my $next_module_version
1248412484
= $delta{$prn}->{changed}->{$module});

dist/Module-CoreList/t/is_core.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!perl -w
22
use strict;
33
use Module::CoreList;
4-
use Test::More tests => 38;
4+
use Test::More tests => 43;
55

66
BEGIN { require_ok('Module::CoreList'); }
77

@@ -28,6 +28,13 @@ ok(Module::CoreList::is_core('attributes', undef, '5.006001') == 1, "attributes
2828
ok(Module::CoreList::is_core('Pod::Plainer', undef, '5.012001') == 1, "Pod::Plainer was core in 5.12.1");
2929
ok(Module::CoreList::is_core('Pod::Plainer', undef, '5.016003') == 0, "Pod::Plainer was removed in 5.13.1");
3030

31+
ok(!Module::CoreList::is_core('File::Temp', 0, '5.006'), 'File::Temp is not in 5.006000');
32+
ok(Module::CoreList::is_core('File::Temp', 0, '5.006001'), 'File::Temp is in 5.006001');
33+
ok(!Module::CoreList::is_core('File::Temp', '0.12', '5.006'), 'File::Temp 0.12 is not in 5.006000');
34+
ok(Module::CoreList::is_core('File::Temp', '0.12', '5.006001'), 'File::Temp 0.12 is in 5.006001');
35+
ok(Module::CoreList::is_core('File::Temp', '0.12', '5.006002'), 'File::Temp 0.12 is in 5.006002');
36+
37+
3138
# history of module 'encoding' in core
3239
# version 1.00 included in 5.007003
3340
# version 1.35 included in 5.008

0 commit comments

Comments
 (0)