5 use MBTest tests => 11;
7 blib_load('Module::Build');
9 my $tmp = MBTest->tmpdir;
12 my $dist = DistGen->new( dir => $tmp );
18 ###################################
19 $dist->change_file( 'Build.PL', <<"---" );
21 my \$build = Module::Build->new(
22 module_name => @{[$dist->name]},
25 \$build->create_build_script;
26 \$build->notes(foo => 'bar');
31 my $mb = Module::Build->new_from_context;
33 is $mb->notes('foo'), 'bar';
35 # Try setting & checking a new value
36 $mb->notes(argh => 'new');
37 is $mb->notes('argh'), 'new';
39 # Change existing value
40 $mb->notes(foo => 'foo');
41 is $mb->notes('foo'), 'foo';
43 # Change back so we can run this test again successfully
44 $mb->notes(foo => 'bar');
45 is $mb->notes('foo'), 'bar';
47 # Check undef vs. 0 vs ''
48 foreach my $val (undef, 0, '') {
49 $mb->notes(null => $val);
50 is $mb->notes('null'), $val;
54 ###################################
55 # Make sure notes set before create_build_script() get preserved
56 $mb = Module::Build->new(module_name => $dist->name);
58 $mb->notes(foo => 'bar');
59 is $mb->notes('foo'), 'bar';
61 $mb->create_build_script;
63 $mb = Module::Build->resume;
65 is $mb->notes('foo'), 'bar';