From 277189c8ad3fc0d1dcd4c757f62b0a7bf5bacaa0 Mon Sep 17 00:00:00 2001 From: Steve Peters Date: Mon, 2 Jul 2007 15:39:52 +0000 Subject: Upgrade to ExtUtils-MakeMaker-6.35 p4raw-id: //depot/perl@31519 --- lib/ExtUtils/t/writemakefile_args.t | 81 ++++++++++++++++++++++++++++++++++--- 1 file changed, 76 insertions(+), 5 deletions(-) (limited to 'lib/ExtUtils/t/writemakefile_args.t') 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, <{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 -- cgit v1.2.1