stas 2003/07/29 08:19:24
Modified: perl-framework/Apache-Test/lib/Apache TestConfig.pm
TestConfigPerl.pm
perl-framework/Apache-Test Changes
Log:
when moving test-specific config directives from __DATA__ to
httpd.conf don't use hash, or the order of arguments is not
preserved. Thanks to perl-5.8.1 for randomizing the hash seed, which
has exposed the bug by breaking the test suite.
Revision Changes Path
1.166 +13 -13
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -r1.165 -r1.166
--- TestConfig.pm 7 Jul 2003 18:42:29 -0000 1.165
+++ TestConfig.pm 29 Jul 2003 15:19:24 -0000 1.166
@@ -370,25 +370,25 @@
sub add_config {
my $self = shift;
my $where = shift;
- my($directive, $arg, $hash) = @_;
+ my($directive, $arg, $data) = @_;
my $args = "";
- if ($hash) {
+ if ($data) {
$args = "<$directive $arg>\n";
- if (ref($hash)) {
- while (my($k,$v) = each %$hash) {
- if (ref($v) eq 'ARRAY') {
- for (@$v) {
- $args .= " $k $_\n";
- }
- }
- else {
- $args .= " $k $v\n";
- }
+ if (ref($data) eq 'HASH') {
+ while (my($k,$v) = each %$data) {
+ $args .= " $k $v\n";
+ }
+ }
+ elsif (ref($data) eq 'ARRAY') {
+ # balanced (key=>val) list
+ my $pairs = @$data / 2;
+ for my $i (0..($pairs-1)) {
+ $args .= sprintf " %s %s\n", $data->[$i*2],
$data->[$i*2+1];
}
}
else {
- $args .= " $hash";
+ $args .= " $data";
}
$args .= "</$directive>\n";
}
1.75 +1 -18
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm
Index: TestConfigPerl.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- TestConfigPerl.pm 14 May 2003 01:12:21 -0000 1.74
+++ TestConfigPerl.pm 29 Jul 2003 15:19:24 -0000 1.75
@@ -498,29 +498,12 @@
}
}
- my $args_hash = list_to_hash_of_lists([EMAIL PROTECTED]);
- $self->postamble($self->$container($module),
- $args_hash) if @args;
+ $self->postamble($self->$container($module), [EMAIL PROTECTED])
if @args;
}
$self->write_pm_test($module, lc $base, lc $sub);
}
}
-
-# turn a balanced (key=>val) list with potentially multiple indentical
-# keys into a hash of lists.
-#############
-sub list_to_hash_of_lists {
- my $arr = shift;
- my %hash = ();
- my $pairs = @$arr / 2;
- for my $i (0..($pairs-1)) {
- my ($key, $val) = ($arr->[$i*2], $arr->[$i*2+1]);
- push @{ $hash{$key} }, $val;
- }
- return \%hash;
-}
-
# scan tests for interesting information
sub run_apache_test_config_scan {
1.33 +5 -0 httpd-test/perl-framework/Apache-Test/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- Changes 22 Jul 2003 11:05:21 -0000 1.32
+++ Changes 29 Jul 2003 15:19:24 -0000 1.33
@@ -8,6 +8,11 @@
=item 1.04-dev -
+when moving test-specific config directives from __DATA__ to
+httpd.conf don't use hash, or the order of arguments is not
+preserved. Thanks to perl-5.8.1 for randomizing the hash seed, which
+has exposed the bug by breaking the test suite. [Stas]
+
when the tests are run in the 'root' mode, check whether the
DocumentRoot is rwx before the tests are run and suggest possible
workarounds when the tests are doomed to fail, because of the