1use Config::Std;
2use Test::More 'no_plan';
3
4my $data = q{
5# A comment
6foo: bar   # Not a trailing comment. This is data for the 'foo' config var
7};
8
9# Read in the config file from Example 19-3...
10read_config \$data => my %config;
11
12write_config %config, \$results;
13is $results, $data    => "Comments preserved on simple round-trip";
14
15$config{""}{foo} = 'baz';
16$data =~ s/bar.*/baz/;
17
18write_config %config, \$results;
19is $results, $data    => "Comments preserved on mutating round-trip";
20