[PATCH] Basic tests for extract_name_ver_from_autodie.

Paul Fenwick pjf at perltraining.com.au
Tue Nov 25 01:39:23 UTC 2008


---
 t/extract_name_ver_from_makefile.t    |   18 ++++++++++++++++++
 t/makefiles/module-install-autodie.PL |   28 ++++++++++++++++++++++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)
 create mode 100644 t/extract_name_ver_from_makefile.t
 create mode 100644 t/makefiles/module-install-autodie.PL

diff --git a/t/extract_name_ver_from_makefile.t b/t/extract_name_ver_from_makefile.t
new file mode 100644
index 0000000..2b3b3e9
--- /dev/null
+++ b/t/extract_name_ver_from_makefile.t
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+use strict;
+use Test::More 'no_plan';
+use FindBin qw($Bin);
+
+require "$Bin/../dh-make-perl";        # Load our code for testing.
+
+my ($name, $ver);
+
+eval {
+  ($name, $ver) = 
+    extract_name_ver_from_makefile("$Bin/makefiles/module-install-autodie.PL");
+};
+
+is($@, "", "Calling extract_name_ver_from_makefile should not die on legit file");
+
+is($name, "autodie", "Module name should be autodie");
+is($ver,  "1.994",   "Module version should be 1.994");
diff --git a/t/makefiles/module-install-autodie.PL b/t/makefiles/module-install-autodie.PL
new file mode 100644
index 0000000..1e67904
--- /dev/null
+++ b/t/makefiles/module-install-autodie.PL
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -w
+use strict;
+use inc::Module::Install;
+
+# This isn't the same as the real autodie makefile, which takes pains
+# to be friendlier to older versions of dh-make-perl.  However it is
+# indicative of what can be found a typical Module::Install file.
+
+name		'autodie';
+
+all_from	'lib/autodie.pm';
+
+version         1.994;
+test_requires	'Test::More';
+author         'Paul Fenwick <pjf at cpan.org>';
+
+requires	'perl' => '5.8.0';
+
+recommends	'IPC::System::Simple' => '0.12'; # For autodying system()
+
+resources      repository => 'http://github.com/pfenwick/autodie/tree/master';
+resources      bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=autodie';
+resources      license    => 'http://dev.perl.org/licenses/';
+resources	Blog       => 'http://pjf.id.au/blog/toc.html?tag=autodie';
+
+installdirs    'perl';    # This overwrites a core module!
+
+WriteAll;
-- 
1.5.5.GIT


--------------020905020405070205070900
Content-Type: text/x-patch;
 name="0004-Permissions-fix.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="0004-Permissions-fix.patch"



More information about the pkg-perl-maintainers mailing list