3 # Things like the CPAN shell rely on the "MakeMaker Parameters" section of the
4 # Makefile to learn a module's dependencies so we'd damn well better test it.
13 use ExtUtils::MakeMaker;
16 my $mm = bless {}, "MM";
19 my ($args, $expected, $label) = @_;
21 map "$_\n", $mm->_MakeMaker_Parameters_section($args || ());
22 $got =~ s/^#\s*MakeMaker Parameters:\n+//;
23 is $got, $expected, $label;
26 process_cmp undef, '', 'nothing';
27 process_cmp { NAME => "Foo" }, <<'EXPECT', "name only";
31 { NAME => "Foo", PREREQ_PM => { "Foo::Bar" => 0 } }, <<'EXPECT', "PREREQ v0";
33 # PREREQ_PM => { Foo::Bar=>q[0] }
36 { NAME => "Foo", PREREQ_PM => { "Foo::Bar" => 1.23 } },
37 <<'EXPECT', "PREREQ v-non-0";
39 # PREREQ_PM => { Foo::Bar=>q[1.23] }
45 PREREQ_PM => { "Foo::Bar" => 1.23 },
46 BUILD_REQUIRES => { "Baz" => 0.12 },
48 <<'EXPECT', "BUILD_REQUIRES";
49 # BUILD_REQUIRES => { Baz=>q[0.12] }
51 # PREREQ_PM => { Baz=>q[0.12], Foo::Bar=>q[1.23] }
57 PREREQ_PM => { "Foo::Bar" => 1.23, Long => 1.45, Short => 0 },
58 BUILD_REQUIRES => { "Baz" => 0.12 },
60 <<'EXPECT', "ensure sorting";
61 # BUILD_REQUIRES => { Baz=>q[0.12] }
63 # PREREQ_PM => { Baz=>q[0.12], Foo::Bar=>q[1.23], Long=>q[1.45], Short=>q[0] }