summaryrefslogtreecommitdiff
path: root/dist/Module-CoreList/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-09-28 15:35:36 +0100
committerNicholas Clark <nick@ccl4.org>2009-09-29 11:12:38 +0100
commitf690bb0c344f8c3bfb040e8baf11083c2a2ae536 (patch)
tree2e11f4f4e10612b1d0f10acf4ce81be5b9a6d00e /dist/Module-CoreList/t
parent88697c04890059636ae16bf315df6e3817777136 (diff)
downloadperl-f690bb0c344f8c3bfb040e8baf11083c2a2ae536.tar.gz
Move Module::CoreList from ext/ to dist/
Diffstat (limited to 'dist/Module-CoreList/t')
-rw-r--r--dist/Module-CoreList/t/corelist.t52
-rw-r--r--dist/Module-CoreList/t/find_modules.t20
-rw-r--r--dist/Module-CoreList/t/pod.t10
3 files changed, 82 insertions, 0 deletions
diff --git a/dist/Module-CoreList/t/corelist.t b/dist/Module-CoreList/t/corelist.t
new file mode 100644
index 0000000000..a79e58c1d3
--- /dev/null
+++ b/dist/Module-CoreList/t/corelist.t
@@ -0,0 +1,52 @@
+#!perl -w
+use strict;
+use Module::CoreList;
+use Test::More tests => 13;
+
+BEGIN { require_ok('Module::CoreList'); }
+
+ok($Module::CoreList::version{5.00503}, "5.00503");
+
+ok(!exists $Module::CoreList::version{5.00503}{attributes},
+ "attributes weren't in 5.00503");
+
+ok($Module::CoreList::version{5.006001}, "5.006001");
+
+ok(exists $Module::CoreList::version{'5.006001'}{attributes},
+ "attributes were in 5.6.1");
+
+ok($Module::CoreList::version{5.007003}, "5.007003");
+
+ok(exists $Module::CoreList::version{5.007003}{'Attribute::Handlers'},
+ "Attribute::Handlers were bundled with 5.7.3");
+
+is(Module::CoreList->first_release_by_date('File::Spec'), 5.005,
+ "File::Spec was first bundled in 5.005");
+
+is(Module::CoreList->first_release('File::Spec'), 5.00405,
+ "File::Spec was released in perl with lowest version number 5.00405");
+
+is(Module::CoreList->first_release('File::Spec', 0.82), 5.006_001,
+ "File::Spec reached 0.82 with 5.006_001");
+
+is_deeply([ sort keys %Module::CoreList::released ],
+ [ sort keys %Module::CoreList::version ],
+ "have a note of everythings release");
+
+is_deeply( [ map {
+ exists $Module::CoreList::version{ $_ }{FindExt} ? $_ : ()
+} keys %Module::CoreList::version ],
+ [], "FindExt shouldn't get included rt#6922" );
+
+
+my $consistent = 1;
+for my $family (values %Module::CoreList::families) {
+ my $first = shift @$family;
+ my $has = join " ", sort keys %{ $Module::CoreList::versions{ $first } };
+ for my $member (@$family) {
+ $has eq join " ", sort keys %{ $Module::CoreList::versions{ $member } }
+ or do { diag "$first -> $member family"; $consistent = 0 };
+ }
+}
+is( $consistent, 1,
+ "families seem consistent (descendants have same modules as ancestors)" );
diff --git a/dist/Module-CoreList/t/find_modules.t b/dist/Module-CoreList/t/find_modules.t
new file mode 100644
index 0000000000..243e0dcdda
--- /dev/null
+++ b/dist/Module-CoreList/t/find_modules.t
@@ -0,0 +1,20 @@
+#!perl -w
+use strict;
+use Module::CoreList;
+use Test::More tests => 5;
+
+BEGIN { require_ok('Module::CoreList'); }
+
+is_deeply([ Module::CoreList->find_modules(qr/warnings/) ],
+ [ qw(encoding::warnings warnings warnings::register) ],
+ 'qr/warnings/');
+
+is_deeply([ Module::CoreList->find_modules(qr/IPC::Open/) ],
+ [ qw(IPC::Open2 IPC::Open3) ],
+ 'qr/IPC::Open/');
+
+is_deeply([ Module::CoreList->find_modules(qr/Module::/, 5.008008) ], [], 'qr/Module::/ at 5.008008');
+
+is_deeply([ Module::CoreList->find_modules(qr/Test::H.*::.*s/, 5.006001, 5.007003) ],
+ [ qw(Test::Harness::Assert Test::Harness::Straps) ],
+ 'qr/Test::H.*::.*s/ at 5.006001 and 5.007003');
diff --git a/dist/Module-CoreList/t/pod.t b/dist/Module-CoreList/t/pod.t
new file mode 100644
index 0000000000..fabf93f827
--- /dev/null
+++ b/dist/Module-CoreList/t/pod.t
@@ -0,0 +1,10 @@
+#!perl
+
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+
+plan tests => 2;
+
+pod_file_ok( 'lib/Module/CoreList.pm', 'module pod ok' );
+pod_file_ok( 'corelist', 'script pod ok' );