- fixed rt.cpan.org#40925, $indichar replaced by internal
	  configuration variable EOFseparator, which contains
	  a 256 bit SHA checksum of the date I fixed the bug.
	  This will prevent future conflicts hopefully. In addition
	  it makes it possible to make it customizable, if neccessary,
	  in a future release.

	- fixed rt.cpan.org#42721, return undef for empty values

	- fixed rt.cpan.org#42331, return undef for empty objects

	- fixed rt.cpan.org#44600, comments after blockname
	  causes parser failure.

	- fixed rt.cpan.org#42287, whitespace at beginning or end
	  of a quoted value gets lost after save().

	- fixed rt.cpan.org#46184, variables that were not previously
	  defined are deleted when -InterPolateEnv is enabled. 

	- fixed bug in config loader for FileHandle objects, it
	  supports now any compatible object. Hint by Ingo Schmiegel.

	- applied spelling- and speedup patches by Ville Skyttä.

	- applied documentation patch by Jordan Macdonald.


git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@69 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
Thomas von Dein
2009-10-10 16:46:35 +00:00
parent b75401d426
commit db567b0713
8 changed files with 166 additions and 97 deletions

3
t/cfg.16a Normal file
View File

@@ -0,0 +1,3 @@
<etc>
log = ${HOME}/log/logfile # use braces
</etc>

View File

@@ -8,3 +8,6 @@ passwd = sakkra
/* oneline C-style comment */
host = blah.blubber
</db>
<foo> #
bar = baz
</foo>

View File

@@ -33,3 +33,7 @@ host = blah.blubber
<beta>
user2 max
</beta>
quoted = "this one contains whitespace at the end "
quotedwithquotes = " holy crap, it contains \"masked quotes\" and 'single quotes' "

18
t/run.t
View File

@@ -8,7 +8,7 @@
use Data::Dumper;
use Test::More tests => 50;
use Test::More tests => 51;
#use Test::More qw(no_plan);
# ahem, we deliver the test code with a local copy of
@@ -123,6 +123,18 @@ else {
fail("Testing variable interpolation");
}
### 16.a
# testing variable interpolation with %ENV use
my $env = "/home/theunexistent";
$ENV{HOME} = $env;
my $conf16a = new Config::General(-ConfigFile => "t/cfg.16a", -InterPolateVars => 1, -InterPolateEnv => 1, -StrictVars => 0);
my %h16a = $conf16a->getall();
if($h16a{etc}->{log} eq "$env/log/logfile") {
pass("Testing environment variable interpolation");
}
else {
fail("Testing environment variable interpolation");
}
### 17
@@ -291,7 +303,7 @@ TEST
);
my %h26 = $conf26->getall;
my %expected_h26 = (
foo => { 0 => { 0 => '' } },
foo => { 0 => { 0 => undef } },
);
is_deeply(\%h26, \%expected_h26, "testing 0-values in block names");
@@ -405,7 +417,7 @@ my %conf35 = Config::General::ParseConfig(
-SplitDelimiter => '\s*::\s*'
);
my %expect35 = (
'var3 = gamma' => '',
'var3 = gamma' => undef,
'var1' => 'alpha',
'var2' => 'beta'
);