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 ge...@apache.org on 2002/05/29 18:26:49 UTC
cvs commit: modperl/t/net/perl api.pl
geoff 02/05/29 09:26:49
Modified: t/internal api.t
t/net/perl api.pl
Log:
added tests to check for $r->args(undef) and $r->the_request(undef)
Submitted by: geoff
Reviewed by: dougm
Revision Changes Path
1.2 +1 -1 modperl/t/internal/api.t
Index: api.t
===================================================================
RCS file: /home/cvs/modperl/t/internal/api.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- api.t 6 Dec 1997 17:57:12 -0000 1.1
+++ api.t 29 May 2002 16:26:49 -0000 1.2
@@ -1,3 +1,3 @@
use Apache::test;
-print fetch "http://$net::httpserver$net::perldir/api.pl";
+print fetch "http://$net::httpserver$net::perldir/api.pl?arg1=one&arg2=two";
1.49 +17 -2 modperl/t/net/perl/api.pl
Index: api.pl
===================================================================
RCS file: /home/cvs/modperl/t/net/perl/api.pl,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- api.pl 24 Mar 2002 18:22:56 -0000 1.48
+++ api.pl 29 May 2002 16:26:49 -0000 1.49
@@ -16,7 +16,7 @@
my $is_xs = ($r->uri =~ /_xs/);
-my $tests = 75;
+my $tests = 81;
my $is_win32 = WIN32;
$tests += 4 unless $is_win32;
my $test_get_set = Apache->can('set_handlers') && ($tests += 4);
@@ -73,9 +73,16 @@
}
my $the_request = $r->the_request;
-$r->the_request(join ' ', map { $r->$_() } qw(method uri protocol));
+my $request_string = $r->method . ' ' .
+ $r->uri . '?' .
+ $r->args . ' ' .
+ $r->protocol;
+$r->the_request($request_string);
test ++$i, $the_request eq $r->the_request;
printf "old=$the_request, new=%s\n", $r->the_request;
+$r->the_request(undef);
+test ++$i, not $r->the_request;
+test ++$i, not defined $r->the_request;
my $doc_root = $r->document_root;
$r->document_root('/tmp');
@@ -103,6 +110,14 @@
test ++$i, $r->status_line;
test ++$i, $r->method eq "GET";
#test ++$i, $r->method_number
+
+# args
+test ++$i, $r->args eq 'arg1=one&arg2=two';
+$r->args('foo=bar');
+test ++$i, $r->args eq 'foo=bar';
+$r->args(undef);
+test ++$i, not $r->args;
+test ++$i, not defined $r->args;
$r->subprocess_env(SetKey => 'value');
test ++$i, $r->subprocess_env('SetKey') eq 'value';