sorthr $prereqs{run},
$target_pkg => $target_version,
),
+ TESTED_PREREQS => deplist_to_perl(sorthr $prereqs{run}),
BUG_EMAIL => $bug_email,
BUG_QUEUE => $bug_queue,
YEARS => $years,
FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt*"
}
);
+TEMPLATE
+ # ----------------------------------------------------------------------------
+ 't/01-deps.t' => <<'TEMPLATE',
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+my $TESTED_PREREQS = __TESTED_PREREQS__;
+
+plan tests => keys(%$TESTED_PREREQS) + 1;
+
+my @tests = map [ $_ => $TESTED_PREREQS->{$_} ], keys %$TESTED_PREREQS;
+push @tests, [ '__TARGET_PKG__' => '__TARGET_VERSION__' ];
+
+for my $test (@tests) {
+ my ($module, $version) = @$test;
+ local $@;
+ if ($version && $version !~ /^[0._]*$/) {
+ eval "use $module $version ()";
+ is $@, '', "$module v$version is available";
+ } else {
+ eval "use $module ()";
+ is $@, '', "any version of $module is available";
+ }
+}
TEMPLATE
);
--- /dev/null
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+my $TESTED_PREREQS = {
+ 'Browser::Open' => '0',
+ 'Digest::MD5' => '0',
+ 'JSON::PP' => '0',
+ 'PPI::HTML' => '1.07',
+ 'Parallel::Iterator' => '0',
+ 'Pod::Coverage' => '0.06',
+ 'Pod::Coverage::CountParents' => '0',
+ 'Storable' => '0',
+ 'Template' => '2.00',
+};
+
+plan tests => keys(%$TESTED_PREREQS) + 1;
+
+my @tests = map [ $_ => $TESTED_PREREQS->{$_} ], keys %$TESTED_PREREQS;
+push @tests, [ 'Devel::Cover' => '0.93' ];
+
+for my $test (@tests) {
+ my ($module, $version) = @$test;
+ local $@;
+ if ($version && $version !~ /^[0._]*$/) {
+ eval "use $module $version ()";
+ is $@, '', "$module v$version is available";
+ } else {
+ eval "use $module ()";
+ is $@, '', "any version of $module is available";
+ }
+}