You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2004/01/23 01:15:18 UTC
cvs commit: modperl-2.0/t/response/TestAPI server_util.pm
stas 2004/01/22 16:15:18
Modified: t/response/TestVhost config.pm
t/response/TestCompat apache.pm
t/response/TestAPI server_util.pm
Log:
need to use an OS specific path in comparison. canonpath achieves that.
Submitted by: Steve Hay <st...@uk.radan.com>
Revision Changes Path
1.2 +2 -2 modperl-2.0/t/response/TestVhost/config.pm
Index: config.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestVhost/config.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -u -r1.1 -r1.2
--- config.pm 22 Jan 2004 21:55:50 -0000 1.1
+++ config.pm 23 Jan 2004 00:15:18 -0000 1.2
@@ -13,7 +13,7 @@
use Apache::RequestUtil ();
use APR::Table ();
-use File::Spec::Functions qw(catdir);
+use File::Spec::Functions qw(canonpath catdir);
use Apache::Const -compile => 'OK';
@@ -27,7 +27,7 @@
{
my $expected = $r->document_root;
my $received = $r->dir_config->get('DocumentRootCheck');
- ok t_cmp($expected, $received, "DocumentRoot");
+ ok t_cmp(canonpath($expected), canonpath($received), "DocumentRoot");
}
Apache::OK;
1.10 +2 -2 modperl-2.0/t/response/TestCompat/apache.pm
Index: apache.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/apache.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -u -r1.9 -r1.10
--- apache.pm 19 Jan 2004 19:02:41 -0000 1.9
+++ apache.pm 23 Jan 2004 00:15:18 -0000 1.10
@@ -73,7 +73,7 @@
'$r->server_root_relative()');
ok t_cmp(catfile($Apache::Server::CWD, 'conf'),
- $r->server_root_relative('conf'),
+ canonpath($r->server_root_relative('conf')),
"\$r->server_root_relative('conf')");
# Apache->server_root_relative
@@ -81,7 +81,7 @@
Apache::compat::override_mp2_api('Apache::server_root_relative');
ok t_cmp(catfile($Apache::Server::CWD, 'conf'),
- Apache->server_root_relative('conf'),
+ canonpath(Apache->server_root_relative('conf')),
"Apache->server_root_relative('conf')");
ok t_cmp(canonpath($Apache::Server::CWD),
1.12 +4 -3 modperl-2.0/t/response/TestAPI/server_util.pm
Index: server_util.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/server_util.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -u -r1.11 -r1.12
--- server_util.pm 19 Jan 2004 19:59:58 -0000 1.11
+++ server_util.pm 23 Jan 2004 00:15:18 -0000 1.12
@@ -72,7 +72,8 @@
foreach my $p (keys %pools) {
ok t_cmp(catfile($serverroot, 'conf'),
- Apache::Server::server_root_relative($pools{$p}, 'conf'),
+ canonpath(Apache::Server::server_root_relative($pools{$p},
+ 'conf')),
"Apache::Server::server_root_relative($p, 'conf')");
}
@@ -80,7 +81,7 @@
foreach my $obj (keys %objects) {
ok t_cmp(catfile($serverroot, 'conf'),
- $objects{$obj}->server_root_relative('conf'),
+ canonpath($objects{$obj}->server_root_relative('conf')),
"$obj->server_root_relative('conf')");
}
@@ -90,7 +91,7 @@
eval { Apache::Server::server_root_relative($obj, 'conf') };
ok t_cmp(qr/server_root_relative.*no .* key/,
- $@,
+ canonpath($@),
"Apache::Server::server_root_relative(\$obj, 'conf')");
}
Re: cvs commit: modperl-2.0/t/response/TestAPI server_util.pm
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>> ok t_cmp(qr/server_root_relative.*no .* key/,
>> - $@,
>> + canonpath($@),
>> "Apache::Server::server_root_relative(\$obj, 'conf')");
>
>
> I don't understand this change. not only does it not make sense to me
> (using canonpath on a non-path string?), but according to steve's report,
> this test passed on windows ok
Hmm, I wondered about it too, but thought that may be canonpath is smart
enough to find just the path ;) But looking at Steve's report this sub-test
wasn't failing at all:
# testing : Apache::Server::server_root_relative($obj, 'conf')
# expected: (?-xism:server_root_relative.*no .* key)
# received: method `server_root_relative' invoked by a `Apache::Foo'
object with
no `r' key! at C:\Temp\modperl-2.0\t\response/TestAPI/server_util.pm
line 90.
ok 14
so I'll revert that change.
>># testing : Apache::Server::server_root_relative($obj, 'conf')
>># expected: (?-xism:server_root_relative.*no .* key)
>># received: method `server_root_relative' invoked by a `Apache::Foo'
>>object with
>> no `r' key! at C:\Temp\modperl-2.0\t\response/TestAPI/server_util.pm
>>line 90.
>>ok 14
>
>
> as for the rest, sorry about that :)
Not much to be sorry about ;) I never remember that on other OS's Apache calls
return a different path ;) Thanks to Randy and Steve we get those
unintentional bugs of ours to get fixed.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: cvs commit: modperl-2.0/t/response/TestAPI server_util.pm
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> ok t_cmp(qr/server_root_relative.*no .* key/,
> - $@,
> + canonpath($@),
> "Apache::Server::server_root_relative(\$obj, 'conf')");
I don't understand this change. not only does it not make sense to me
(using canonpath on a non-path string?), but according to steve's report,
this test passed on windows ok
> # testing : Apache::Server::server_root_relative($obj, 'conf')
> # expected: (?-xism:server_root_relative.*no .* key)
> # received: method `server_root_relative' invoked by a `Apache::Foo'
> object with
> no `r' key! at C:\Temp\modperl-2.0\t\response/TestAPI/server_util.pm
> line 90.
> ok 14
as for the rest, sorry about that :)
--Geoff
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org