This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move Module::CoreList from ext/ to dist/
[perl5.git] / dist / Module-CoreList / t / corelist.t
CommitLineData
8f2fd531
JB
1#!perl -w
2use strict;
3use Module::CoreList;
79be940f 4use Test::More tests => 13;
8f2fd531
JB
5
6BEGIN { require_ok('Module::CoreList'); }
7
8ok($Module::CoreList::version{5.00503}, "5.00503");
9
10ok(!exists $Module::CoreList::version{5.00503}{attributes},
11 "attributes weren't in 5.00503");
12
13ok($Module::CoreList::version{5.006001}, "5.006001");
14
15ok(exists $Module::CoreList::version{'5.006001'}{attributes},
16 "attributes were in 5.6.1");
17
18ok($Module::CoreList::version{5.007003}, "5.007003");
19
20ok(exists $Module::CoreList::version{5.007003}{'Attribute::Handlers'},
21 "Attribute::Handlers were bundled with 5.7.3");
22
79be940f 23is(Module::CoreList->first_release_by_date('File::Spec'), 5.005,
8f2fd531
JB
24 "File::Spec was first bundled in 5.005");
25
79be940f
RGS
26is(Module::CoreList->first_release('File::Spec'), 5.00405,
27 "File::Spec was released in perl with lowest version number 5.00405");
28
8f2fd531
JB
29is(Module::CoreList->first_release('File::Spec', 0.82), 5.006_001,
30 "File::Spec reached 0.82 with 5.006_001");
31
32is_deeply([ sort keys %Module::CoreList::released ],
33 [ sort keys %Module::CoreList::version ],
34 "have a note of everythings release");
35
36is_deeply( [ map {
37 exists $Module::CoreList::version{ $_ }{FindExt} ? $_ : ()
38} keys %Module::CoreList::version ],
39 [], "FindExt shouldn't get included rt#6922" );
40
41
42my $consistent = 1;
43for my $family (values %Module::CoreList::families) {
44 my $first = shift @$family;
45 my $has = join " ", sort keys %{ $Module::CoreList::versions{ $first } };
46 for my $member (@$family) {
47 $has eq join " ", sort keys %{ $Module::CoreList::versions{ $member } }
48 or do { diag "$first -> $member family"; $consistent = 0 };
49 }
50}
51is( $consistent, 1,
52 "families seem consistent (descendants have same modules as ancestors)" );