Skip Menu |

This queue is for tickets about the Config-General CPAN distribution.

Report information
The Basics
Id: 17852
Status: resolved
Priority: 3/
Queue: Config-General

People
Owner: tlinden [...] cpan.org
Requestors: scop [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.31
Fixed in: (no value)



Subject: Problem with zeros
There are some issues with handling 0's in Config::General. I'm attaching a patch containing a reproducer for the test suite.
Subject: config-general-0.patch
--- t/run.t~ 2006-01-11 14:45:47.000000000 +0200 +++ t/run.t 2006-02-25 01:56:52.000000000 +0200 @@ -6,7 +6,7 @@ # # Under normal circumstances every test should succeed. -BEGIN { $| = 1; print "1..24\n";} +BEGIN { $| = 1; print "1..25\n";} use lib "blib/lib"; use Config::General; use Data::Dumper; @@ -369,7 +369,30 @@ pause; +# Testing 0-value handling +my $conf26 = Config::General->new( + -String => <<TEST, +<foo 0> + 0 +</foo> +TEST +); +my %h26 = $conf26->getall; + +my %expected_h26 = ( + foo => { 0 => { 0 => undef } }, +); + +if (&comp(\%h26, \%expected_h26)) { + print "ok\n"; + print STDERR " .. ok # 0-values\n"; +} +else { + print "26 not ok\n"; + print STDERR "26 not ok\n"; +} +pause; # all subs here
Sorry for the late reply - RT didn't notify me of new tickets. I'll review the problem.
Applied patch to t/run. Fixed bug in 2.32 - using defined now to check if a blockname exists.