3 # This is a test of the verification of the arguments to
11 use Test::More tests => 35;
14 use MakeMaker::Test::Utils;
15 use MakeMaker::Test::Setup::BFD;
17 use ExtUtils::MakeMaker;
23 ok( setup_recurs(), 'setup' );
25 ok( chdir File::Spec->updir );
26 ok( teardown_recurs(), 'teardown' );
29 ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
30 diag("chdir failed: $!");
33 ok( my $stdout = tie *STDOUT, 'TieOut' );
35 local $SIG{__WARN__} = sub {
36 $warnings .= join '', @_;
44 VERSION_FROM => 'lib/Big/Dummy.pm',
45 MAN3PODS => ' ', # common mistake
49 is( $warnings, <<VERIFY );
50 WARNING: MAN3PODS takes a HASH reference not a string/number.
51 Please inform the author.
58 VERSION_FROM => 'lib/Big/Dummy.pm',
63 is( $warnings, <<VERIFY );
64 WARNING: AUTHOR takes a string/number not a CODE reference.
65 Please inform the author.
68 # LIBS accepts *both* a string or an array ref. The first cut of
69 # our verification did not take this into account.
73 VERSION_FROM => 'lib/Big/Dummy.pm',
74 LIBS => '-lwibble -lwobble',
77 # We'll get warnings about the bogus libs, that's ok.
78 unlike( $warnings, qr/WARNING: .* takes/ );
79 is_deeply( $mm->{LIBS}, ['-lwibble -lwobble'] );
84 VERSION_FROM => 'lib/Big/Dummy.pm',
85 LIBS => ['-lwibble', '-lwobble'],
88 # We'll get warnings about the bogus libs, that's ok.
89 unlike( $warnings, qr/WARNING: .* takes/ );
90 is_deeply( $mm->{LIBS}, ['-lwibble', '-lwobble'] );
96 VERSION_FROM => 'lib/Big/Dummy.pm',
97 LIBS => { wibble => "wobble" },
101 # We'll get warnings about the bogus libs, that's ok.
102 like( $warnings, qr{^WARNING: LIBS takes a ARRAY reference or string/number not a HASH reference}m );
107 NAME => 'Big::Dummy',
108 WIBBLE => 'something',
109 wump => { foo => 42 },
112 like( $warnings, qr{^WARNING: WIBBLE is not a known parameter.\n}m );
113 like( $warnings, qr{^WARNING: wump is not a known parameter.\n}m );
115 is( $mm->{WIBBLE}, 'something' );
116 is_deeply( $mm->{wump}, { foo => 42 } );
123 NAME => 'Big::Dummy',
127 like( $warnings, qr{^WARNING: VERSION takes a version object or string/number} );
132 NAME => 'Big::Dummy',
133 VERSION => 1.002_003,
137 is( $mm->{VERSION}, '1.002003' );
142 NAME => 'Big::Dummy',
143 VERSION => '1.002_003',
147 is( $mm->{VERSION}, '1.002_003' );
153 NAME => 'Big::Dummy',
154 VERSION => bless {}, "Some::Class",
157 like( $warnings, '/^WARNING: VERSION takes a version object or string/number not a Some::Class object/' );
161 skip("Can't test version objects", 8) unless eval { require version };
164 my $version = version->new("1.2.3");
168 NAME => 'Big::Dummy',
173 isa_ok( $mm->{VERSION}, 'version' );
174 is( $mm->{VERSION}, $version );
177 $version = qv('1.2.3');
180 NAME => 'Big::Dummy',
185 isa_ok( $mm->{VERSION}, 'version' );
186 is( $mm->{VERSION}, $version );
194 NAME => 'Big::Dummy',
196 DISTNAME => "Hooballa",
200 is( $mm->{DISTNAME}, "Hooballa" );
201 is( $mm->{DISTVNAME}, $Is_VMS ? "Hooballa-1_00" : "Hooballa-1.00" );
204 # DISTVNAME (rt.cpan.org 43217)
208 NAME => 'Big::Dummy',
210 DISTVNAME => "Hooballoo",
214 is( $mm->{DISTVNAME}, 'Hooballoo' );