3 # This is a test of the verification of the arguments to
7 if( $ENV{PERL_CORE} ) {
9 @INC = ('../lib', 'lib');
12 unshift @INC, 't/lib';
17 use Test::More tests => 35;
20 use MakeMaker::Test::Utils;
21 use MakeMaker::Test::Setup::BFD;
23 use ExtUtils::MakeMaker;
29 ok( setup_recurs(), 'setup' );
31 ok( chdir File::Spec->updir );
32 ok( teardown_recurs(), 'teardown' );
35 ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
36 diag("chdir failed: $!");
39 ok( my $stdout = tie *STDOUT, 'TieOut' );
41 local $SIG{__WARN__} = sub {
42 $warnings .= join '', @_;
50 VERSION_FROM => 'lib/Big/Dummy.pm',
51 MAN3PODS => ' ', # common mistake
55 is( $warnings, <<VERIFY );
56 WARNING: MAN3PODS takes a HASH reference not a string/number.
57 Please inform the author.
64 VERSION_FROM => 'lib/Big/Dummy.pm',
69 is( $warnings, <<VERIFY );
70 WARNING: AUTHOR takes a string/number not a CODE reference.
71 Please inform the author.
74 # LIBS accepts *both* a string or an array ref. The first cut of
75 # our verification did not take this into account.
79 VERSION_FROM => 'lib/Big/Dummy.pm',
80 LIBS => '-lwibble -lwobble',
83 # We'll get warnings about the bogus libs, that's ok.
84 unlike( $warnings, qr/WARNING: .* takes/ );
85 is_deeply( $mm->{LIBS}, ['-lwibble -lwobble'] );
90 VERSION_FROM => 'lib/Big/Dummy.pm',
91 LIBS => ['-lwibble', '-lwobble'],
94 # We'll get warnings about the bogus libs, that's ok.
95 unlike( $warnings, qr/WARNING: .* takes/ );
96 is_deeply( $mm->{LIBS}, ['-lwibble', '-lwobble'] );
101 NAME => 'Big::Dummy',
102 VERSION_FROM => 'lib/Big/Dummy.pm',
103 LIBS => { wibble => "wobble" },
107 # We'll get warnings about the bogus libs, that's ok.
108 like( $warnings, qr{^WARNING: LIBS takes a ARRAY reference or string/number not a HASH reference}m );
113 NAME => 'Big::Dummy',
114 WIBBLE => 'something',
115 wump => { foo => 42 },
118 like( $warnings, qr{^WARNING: WIBBLE is not a known parameter.\n}m );
119 like( $warnings, qr{^WARNING: wump is not a known parameter.\n}m );
121 is( $mm->{WIBBLE}, 'something' );
122 is_deeply( $mm->{wump}, { foo => 42 } );
129 NAME => 'Big::Dummy',
133 like( $warnings, qr{^WARNING: VERSION takes a version object or string/number} );
138 NAME => 'Big::Dummy',
139 VERSION => 1.002_003,
143 is( $mm->{VERSION}, '1.002003' );
148 NAME => 'Big::Dummy',
149 VERSION => '1.002_003',
153 is( $mm->{VERSION}, '1.002_003' );
159 NAME => 'Big::Dummy',
160 VERSION => bless {}, "Some::Class",
163 like( $warnings, '/^WARNING: VERSION takes a version object or string/number not a Some::Class object/' );
167 skip("Can't test version objects", 8) unless eval { require version };
170 my $version = version->new("1.2.3");
174 NAME => 'Big::Dummy',
179 isa_ok( $mm->{VERSION}, 'version' );
180 is( $mm->{VERSION}, $version );
183 $version = qv('1.2.3');
186 NAME => 'Big::Dummy',
191 isa_ok( $mm->{VERSION}, 'version' );
192 is( $mm->{VERSION}, $version );
200 NAME => 'Big::Dummy',
202 DISTNAME => "Hooballa",
206 is( $mm->{DISTNAME}, "Hooballa" );
207 is( $mm->{DISTVNAME}, $Is_VMS ? "Hooballa-1_00" : "Hooballa-1.00" );
210 # DISTVNAME (rt.cpan.org 43217)
214 NAME => 'Big::Dummy',
216 DISTVNAME => "Hooballoo",
220 is( $mm->{DISTVNAME}, 'Hooballoo' );