mirror of
https://codeberg.org/scip/Config-General.git
synced 2025-12-16 20:21:01 +01:00
added -ForceArray flag which makes it possible to use single value arrays
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@78 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
13
t/run.t
13
t/run.t
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
use Data::Dumper;
|
||||
use Test::More tests => 61;
|
||||
use Test::More tests => 63;
|
||||
#use Test::More qw(no_plan);
|
||||
|
||||
# ahem, we deliver the test code with a local copy of
|
||||
@@ -702,3 +702,14 @@ $cfg51->save_file("t/cfg.51.out");
|
||||
$cfg51 = new Config::General( -ConfigFile => "t/cfg.51.out", -InterPolateVars => 1 );
|
||||
my %hash51new = $cfg51->getall();
|
||||
is_deeply(\%hash51, \%hash51new, "compare saved config containing escaped chars");
|
||||
|
||||
|
||||
# check if forced single value arrays remain
|
||||
my $cfg52 = new Config::General( -String => "habeas = [ corpus ]", -ForceArray => 1);
|
||||
my %hash52 = $cfg52->getall();
|
||||
my @array52 = qw(corpus);
|
||||
is_deeply($hash52{habeas}, \@array52, "check -ForceArray single value arrays");
|
||||
$cfg52->save_file("t/cfg.52.out");
|
||||
$cfg52 = new Config::General( -ConfigFile => "t/cfg.52.out", -ForceArray => 1);
|
||||
my %hash52new = $cfg52->getall();
|
||||
is_deeply(\%hash52new, \%hash52, "check -ForceArray single value arrays during save()");
|
||||
|
||||
Reference in New Issue
Block a user