mirror of
https://codeberg.org/scip/Config-General.git
synced 2025-12-16 20:21:01 +01:00
2.03 - fixed bug in the _parse() routine (better: design flaw).
after the last patch for allowing whitespaces in option names, it had a problem with here-docs which contained equal signs. option/value splitting resulted in weird output. - as a side effect of the bug fix below it is now possible to use equal signs inside quoted values, which will then be ignored, thus not used for splitting the line into an option/value assignment. - added a new test, which tests for all possible notations of option/value lines. git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@29 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
16
t/cfg.19
Normal file
16
t/cfg.19
Normal file
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# these options must all in
|
||||
# msg[\d] keys.
|
||||
#
|
||||
msg1 = "Das ist ein Test"
|
||||
msg2 = "Das = ein Test"
|
||||
msg3 "Das ist ein Test"
|
||||
msg4 "Das = ein Test"
|
||||
|
||||
msg6 = <<EOF
|
||||
Das = ein Test
|
||||
EOF
|
||||
|
||||
msg7 <<EOF
|
||||
Das = ein Test
|
||||
msg7
|
||||
9
t/cfg.4
9
t/cfg.4
@@ -1,7 +1,14 @@
|
||||
/*
|
||||
# Here-document test
|
||||
message <<EOF
|
||||
message = <<EOF
|
||||
yes. we are not here. you
|
||||
can reach us somewhere in
|
||||
outerspace.
|
||||
# and this line will remain inside the here-doc!
|
||||
EOF
|
||||
*/
|
||||
|
||||
header = <<EOF
|
||||
<table border="0">
|
||||
</table>
|
||||
EOF
|
||||
20
t/run.t
20
t/run.t
@@ -6,7 +6,7 @@
|
||||
#
|
||||
# Under normal circumstances every test should succeed.
|
||||
|
||||
BEGIN { $| = 1; print "1..18\n";}
|
||||
BEGIN { $| = 1; print "1..19\n";}
|
||||
use lib "blib/lib";
|
||||
use Config::General;
|
||||
use Data::Dumper;
|
||||
@@ -170,7 +170,23 @@ else {
|
||||
|
||||
|
||||
|
||||
|
||||
# testing various otion/value assignemnt notations
|
||||
my $conf19 = new Config::General(-file => "t/cfg.19");
|
||||
my %h19 = $conf19->getall();
|
||||
my $works = 1;
|
||||
foreach my $key (keys %h19) {
|
||||
if ($key =~ /\s/) {
|
||||
$works = 0;
|
||||
}
|
||||
}
|
||||
if ($works) {
|
||||
print "ok\n";
|
||||
print STDERR " .. ok # Testing various otion/value assignemnt notations\n";
|
||||
}
|
||||
else {
|
||||
print "19 not ok\n";
|
||||
print STDERR "19 not ok\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user