summaryrefslogtreecommitdiff
path: root/lib/ExtUtils/t/writemakefile_args.t
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2007-07-02 15:39:52 +0000
committerSteve Peters <steve@fisharerojo.org>2007-07-02 15:39:52 +0000
commit277189c8ad3fc0d1dcd4c757f62b0a7bf5bacaa0 (patch)
tree5c8f3e174b3714c1e7556d10e66d7b4f71402e27 /lib/ExtUtils/t/writemakefile_args.t
parent28f2d4d1a9ee0dc43de025aac86c30a6932449c8 (diff)
downloadperl-277189c8ad3fc0d1dcd4c757f62b0a7bf5bacaa0.tar.gz
Upgrade to ExtUtils-MakeMaker-6.35
p4raw-id: //depot/perl@31519
Diffstat (limited to 'lib/ExtUtils/t/writemakefile_args.t')
-rw-r--r--lib/ExtUtils/t/writemakefile_args.t81
1 files changed, 76 insertions, 5 deletions
diff --git a/lib/ExtUtils/t/writemakefile_args.t b/lib/ExtUtils/t/writemakefile_args.t
index a19a5ee644..e7b2db5ec2 100644
--- a/lib/ExtUtils/t/writemakefile_args.t
+++ b/lib/ExtUtils/t/writemakefile_args.t
@@ -14,7 +14,7 @@ BEGIN {
}
use strict;
-use Test::More tests => 16;
+use Test::More 'no_plan';
use TieOut;
use MakeMaker::Test::Utils;
@@ -53,7 +53,7 @@ ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
};
is( $warnings, <<VERIFY );
-WARNING: MAN3PODS takes a hash reference not a string/number.
+WARNING: MAN3PODS takes a HASH reference not a string/number.
Please inform the author.
VERIFY
@@ -67,7 +67,7 @@ VERIFY
};
is( $warnings, <<VERIFY );
-WARNING: AUTHOR takes a string/number not a code reference.
+WARNING: AUTHOR takes a string/number not a CODE reference.
Please inform the author.
VERIFY
@@ -105,7 +105,7 @@ VERIFY
};
# We'll get warnings about the bogus libs, that's ok.
- like( $warnings, qr{^WARNING: LIBS takes a array reference or string/number not a hash reference}m );
+ like( $warnings, qr{^WARNING: LIBS takes a ARRAY reference or string/number not a HASH reference}m );
$warnings = '';
@@ -120,4 +120,75 @@ VERIFY
is( $mm->{WIBBLE}, 'something' );
is_deeply( $mm->{wump}, { foo => 42 } );
-}
+
+
+ # Test VERSION
+ $warnings = '';
+ eval {
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION => [1,2,3],
+ );
+ };
+ like( $warnings, qr{^WARNING: VERSION takes a version object or string/number} );
+
+ $warnings = '';
+ eval {
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION => 1.002_003,
+ );
+ };
+ is( $warnings, '' );
+ is( $mm->{VERSION}, '1.002003' );
+
+ $warnings = '';
+ eval {
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION => '1.002_003',
+ );
+ };
+ is( $warnings, '' );
+ is( $mm->{VERSION}, '1.002_003' );
+
+
+ $warnings = '';
+ eval {
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION => bless {}, "Some::Class",
+ );
+ };
+ like( $warnings, '/^WARNING: VERSION takes a version object or string/number not a Some::Class object/' );
+
+
+ SKIP: {
+ skip("Can't test version objects",2) unless eval { require version };
+ version->import;
+
+ my $version = version->new("1.2.3");
+ $warnings = '';
+ eval {
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION => $version,
+ );
+ };
+ is( $warnings, '' );
+ isa_ok( $mm->{VERSION}, 'version' );
+ is( $mm->{VERSION}, $version );
+
+ $warnings = '';
+ $version = qv('1.2.3');
+ eval {
+ $mm = WriteMakefile(
+ NAME => 'Big::Dummy',
+ VERSION => $version,
+ );
+ };
+ is( $warnings, '' );
+ isa_ok( $mm->{VERSION}, 'version' );
+ is( $mm->{VERSION}, $version );
+ }
+} \ No newline at end of file