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 => 13;
20 use MakeMaker::Test::Utils;
22 use ExtUtils::MakeMaker;
28 ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
29 diag("chdir failed: $!");
32 ok( my $stdout = tie *STDOUT, 'TieOut' );
34 local $SIG{__WARN__} = sub {
35 $warnings .= join '', @_;
43 VERSION_FROM => 'lib/Big/Dummy.pm',
44 MAN3PODS => ' ', # common mistake
48 is( $warnings, <<VERIFY );
49 WARNING: MAN3PODS takes a hash reference not a string/number.
50 Please inform the author.
57 VERSION_FROM => 'lib/Big/Dummy.pm',
62 is( $warnings, <<VERIFY );
63 WARNING: AUTHOR takes a string/number not a code reference.
64 Please inform the author.
67 # LIBS accepts *both* a string or an array ref. The first cut of
68 # our verification did not take this into account.
72 VERSION_FROM => 'lib/Big/Dummy.pm',
73 LIBS => '-lwibble -lwobble',
76 # We'll get warnings about the bogus libs, that's ok.
77 unlike( $warnings, qr/WARNING: .* takes/ );
78 is_deeply( $mm->{LIBS}, ['-lwibble -lwobble'] );
83 VERSION_FROM => 'lib/Big/Dummy.pm',
84 LIBS => ['-lwibble', '-lwobble'],
87 # We'll get warnings about the bogus libs, that's ok.
88 unlike( $warnings, qr/WARNING: .* takes/ );
89 is_deeply( $mm->{LIBS}, ['-lwibble', '-lwobble'] );
95 VERSION_FROM => 'lib/Big/Dummy.pm',
96 LIBS => { wibble => "wobble" },
100 # We'll get warnings about the bogus libs, that's ok.
101 like( $warnings, qr{^WARNING: LIBS takes a array reference or string/number not a hash reference}m );
106 NAME => 'Big::Dummy',
107 WIBBLE => 'something',
108 wump => { foo => 42 },
111 like( $warnings, qr{^WARNING: WIBBLE is not a known parameter.\n}m );
112 like( $warnings, qr{^WARNING: wump is not a known parameter.\n}m );
114 is( $mm->{WIBBLE}, 'something' );
115 is_deeply( $mm->{wump}, { foo => 42 } );