Commit | Line | Data |
---|---|---|
8f2fd531 JB |
1 | #!perl -w |
2 | use strict; | |
3 | use Module::CoreList; | |
79be940f | 4 | use Test::More tests => 13; |
8f2fd531 JB |
5 | |
6 | BEGIN { require_ok('Module::CoreList'); } | |
7 | ||
8 | ok($Module::CoreList::version{5.00503}, "5.00503"); | |
9 | ||
10 | ok(!exists $Module::CoreList::version{5.00503}{attributes}, | |
11 | "attributes weren't in 5.00503"); | |
12 | ||
13 | ok($Module::CoreList::version{5.006001}, "5.006001"); | |
14 | ||
15 | ok(exists $Module::CoreList::version{'5.006001'}{attributes}, | |
16 | "attributes were in 5.6.1"); | |
17 | ||
18 | ok($Module::CoreList::version{5.007003}, "5.007003"); | |
19 | ||
20 | ok(exists $Module::CoreList::version{5.007003}{'Attribute::Handlers'}, | |
21 | "Attribute::Handlers were bundled with 5.7.3"); | |
22 | ||
79be940f | 23 | is(Module::CoreList->first_release_by_date('File::Spec'), 5.005, |
8f2fd531 JB |
24 | "File::Spec was first bundled in 5.005"); |
25 | ||
79be940f RGS |
26 | is(Module::CoreList->first_release('File::Spec'), 5.00405, |
27 | "File::Spec was released in perl with lowest version number 5.00405"); | |
28 | ||
8f2fd531 JB |
29 | is(Module::CoreList->first_release('File::Spec', 0.82), 5.006_001, |
30 | "File::Spec reached 0.82 with 5.006_001"); | |
31 | ||
32 | is_deeply([ sort keys %Module::CoreList::released ], | |
33 | [ sort keys %Module::CoreList::version ], | |
34 | "have a note of everythings release"); | |
35 | ||
36 | is_deeply( [ map { | |
37 | exists $Module::CoreList::version{ $_ }{FindExt} ? $_ : () | |
38 | } keys %Module::CoreList::version ], | |
39 | [], "FindExt shouldn't get included rt#6922" ); | |
40 | ||
41 | ||
42 | my $consistent = 1; | |
43 | for 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 | } | |
51 | is( $consistent, 1, | |
52 | "families seem consistent (descendants have same modules as ancestors)" ); |