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