randyk 2004/07/10 19:08:47
Modified: env/t big_request.t cgi.t cookie.t request.t
Log:
swap order of args passed to t_cmp in env/t/ tests, to use new syntax
t_cmp($received, $expected, $comment) in latest Apache-Test (1.12).
Revision Changes Path
1.4 +4 -4 httpd-apreq-2/env/t/big_request.t
Index: big_request.t
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/t/big_request.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- big_request.t 27 Jun 2004 17:50:49 -0000 1.3
+++ big_request.t 11 Jul 2004 02:08:47 -0000 1.4
@@ -39,8 +39,8 @@
t_debug "# of keys : $key_num, key_len $key_len";
my $body = GET_BODY "$location?$query";
- ok t_cmp($len,
- $body,
+ ok t_cmp($body,
+ $len,
"GET long query");
}
@@ -61,8 +61,8 @@
t_debug "# of keys : $big_key_num, big_key_len $big_key_len";
my $body = POST_BODY($location, content => $query);
- ok t_cmp($len,
- $body,
+ ok t_cmp($body,
+ $len,
"POST big data");
}
1.5 +14 -14 httpd-apreq-2/env/t/cgi.t
Index: cgi.t
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/t/cgi.t,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- cgi.t 11 Jul 2004 01:38:26 -0000 1.4
+++ cgi.t 11 Jul 2004 02:08:47 -0000 1.5
@@ -39,8 +39,8 @@
t_debug "# of keys : $key_num, key_len $key_len";
my $body = GET_BODY "$script?$query";
- ok t_cmp($len,
- $body,
+ ok t_cmp($body,
+ $len,
"GET long query");
}
@@ -61,32 +61,32 @@
t_debug "# of keys : $big_key_num, big_key_len $big_key_len";
my $body = POST_BODY($script, content => $query);
- ok t_cmp($len,
- $body,
+ ok t_cmp($body,
+ $len,
"POST big data");
}
}
-ok t_cmp("\tfoo => 1$line_end",
- POST_BODY("$script?foo=1", Content => $filler), "simple post");
+ok t_cmp(POST_BODY("$script?foo=1", Content => $filler),
+ "\tfoo => 1$line_end", "simple post");
-ok t_cmp("\tfoo => ?$line_end\tbar => hello world$line_end",
- GET_BODY("$script?foo=%3F&bar=hello+world"), "simple get");
+ok t_cmp(GET_BODY("$script?foo=%3F&bar=hello+world"),
+ "\tfoo => ?$line_end\tbar => hello world$line_end", "simple get");
my $body = POST_BODY($script, content =>
"aaa=$filler;foo=1;bar=2;filler=$filler");
-ok t_cmp("\tfoo => 1$line_end\tbar => 2$line_end",
- $body, "simple post");
+ok t_cmp($body, "\tfoo => 1$line_end\tbar => 2$line_end",
+ "simple post");
$body = POST_BODY("$script?foo=1", content =>
"intro=$filler&bar=2&conclusion=$filler");
-ok t_cmp("\tfoo => 1$line_end\tbar => 2$line_end",
- $body, "simple post");
+ok t_cmp($body, "\tfoo => 1$line_end\tbar => 2$line_end",
+ "simple post");
$body = UPLOAD_BODY("$script?foo=0", content => $filler);
-ok t_cmp("\tfoo => 0$line_end",
- $body, "simple upload");
+ok t_cmp($body, "\tfoo => 0$line_end",
+ "simple upload");
{
1.3 +8 -8 httpd-apreq-2/env/t/cookie.t
Index: cookie.t
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/t/cookie.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cookie.t 11 Jun 2004 17:43:07 -0000 1.2
+++ cookie.t 11 Jul 2004 02:08:47 -0000 1.3
@@ -17,8 +17,8 @@
my $key = 'apache';
my $value = 'ok';
my $cookie = qq{$key=$value};
- ok t_cmp($value,
- GET_BODY("$location?test=$test&key=$key", Cookie => $cookie),
+ ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie),
+ $value,
$test);
}
{
@@ -26,8 +26,8 @@
my $key = 'apache';
my $value = 'ok';
my $cookie = qq{\$Version="1"; $key="$value"; \$Path="$location"};
- ok t_cmp(qq{"$value"},
- GET_BODY("$location?test=$test&key=$key", Cookie => $cookie),
+ ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie),
+ qq{"$value"},
$test);
}
{
@@ -36,8 +36,8 @@
my $value = 'okie dokie';
my $cookie = "$key=" . join '',
map {/ / ? '+' : sprintf '%%%.2X', ord} split //, $value;
- ok t_cmp($value,
- GET_BODY("$location?test=$test&key=$key", Cookie => $cookie),
+ ok t_cmp(GET_BODY("$location?test=$test&key=$key", Cookie => $cookie),
+ $value,
$test);
}
{
@@ -48,7 +48,7 @@
my ($header) = GET_HEAD("$location?test=$test&key=$key",
Cookie => $cookie) =~ /^#Set-Cookie:\s+(.+)/m;
- ok t_cmp($cookie, $header, $test);
+ ok t_cmp($header, $cookie, $test);
}
{
my $test = 'bake2';
@@ -57,5 +57,5 @@
my $cookie = qq{\$Version="1"; $key="$value"; \$Path="$location"};
my ($header) = GET_HEAD("$location?test=$test&key=$key",
Cookie => $cookie) =~ /^#Set-Cookie2:\s+(.+)/m;
- ok t_cmp(qq{$key="$value"; Version=1; path="$location"}, $header, $test);
+ ok t_cmp($header, qq{$key="$value"; Version=1; path="$location"}, $test);
}
1.11 +20 -20 httpd-apreq-2/env/t/request.t
Index: request.t
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/t/request.t,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- request.t 15 Jun 2004 07:55:15 -0000 1.10
+++ request.t 11 Jul 2004 02:08:47 -0000 1.11
@@ -15,20 +15,20 @@
foreach my $location ('/apreq_request_test', '/apreq_access_test') {
- ok t_cmp("ARGS:\n\ttest => 1\n",
- GET_BODY("$location?test=1"), "simple get");
+ ok t_cmp(GET_BODY("$location?test=1"), "ARGS:\n\ttest => 1\n",
+ "simple get");
- ok t_cmp("ARGS:\n\ttest => 2\nBODY:\n\tHTTPUPLOAD => b\n",
- UPLOAD_BODY("$location?test=2", content => "unused"),
- "simple upload");
+ ok t_cmp(UPLOAD_BODY("$location?test=2", content => "unused"),
+ "ARGS:\n\ttest => 2\nBODY:\n\tHTTPUPLOAD => b\n",
+ "simple upload");
}
-ok t_cmp(403, GET_RC("/apreq_access_test"), "access denied");
+ok t_cmp(GET_RC("/apreq_access_test"), 403, "access denied");
my $filler = "0123456789" x 6400; # < 64K
my $body = POST_BODY("/apreq_access_test?foo=1;",
content => "bar=2&quux=$filler;test=6&more=$filler");
-ok t_cmp(<<EOT, $body, "prefetch credentials");
+ok t_cmp($body, <<EOT, "prefetch credentials");
ARGS:
\tfoo => 1
BODY:
@@ -38,17 +38,17 @@
\tmore => $filler
EOT
-ok t_cmp(403, GET_RC("/apreq_redirect_test"), "missing 'test'
authorization");
+ok t_cmp(GET_RC("/apreq_redirect_test"), 403, "missing 'test'
authorization");
foreach my $location ('/apreq_request_test', '/apreq_access_test') {
- ok t_cmp("ARGS:\n\ttest => redirect\n",
-
GET_BODY("/apreq_redirect_test?test=ok&location=$location%3Ftest=redirect"),
- "redirect GET");
+ ok
t_cmp(GET_BODY("/apreq_redirect_test?test=ok&location=$location%3Ftest=redirect"),
+ "ARGS:\n\ttest => redirect\n",
+ "redirect GET");
$body = POST_BODY("/apreq_redirect_test?location=$location%3Ffoo=bar",
content =>
"quux=$filler;test=redirect+with+prefetch;more=$filler");
- ok t_cmp(<<EOT, $body, "redirect with prefetch");
+ ok t_cmp($body, <<EOT, "redirect with prefetch");
ARGS:
\tfoo => bar
BODY:
@@ -66,11 +66,13 @@
return $body;
}
-ok t_cmp(200, GET_RC("/index.html"), "/index.html");
-ok t_cmp("ARGS:\n\ttest => 13\n", filter_content
- GET_BODY("/index.html?test=13"), "output filter GET");
-
-ok t_cmp(<<EOT,
+ok t_cmp(GET_RC("/index.html"), 200, "/index.html");
+ok t_cmp(filter_content GET_BODY("/index.html?test=13"),
+ "ARGS:\n\ttest => 13\n", "output filter GET");
+
+ok t_cmp(filter_content POST_BODY("/index.html?test=14", content =>
+ "post+data=foo;more=$filler;test=output+filter+POST"),
+ <<EOT,
ARGS:
\ttest => 14
BODY:
@@ -78,9 +80,7 @@
\tmore => $filler
\ttest => output filter POST
EOT
- filter_content POST_BODY("/index.html?test=14", content =>
- "post+data=foo;more=$filler;test=output+filter+POST"),
- "output filter POST");
+ "output filter POST");
if (Apache::Test::have_ssl() and $scheme ne 'https') {
$scheme = 'https';