Well, I posted too fast. Scratch that first diff for this version which
has a bit more detail about how the UPLOAD function is working.


William

-- 
Knowmad Services Inc.
http://www.knowmad.com
--- testing.pod.orig    2005-07-06 09:21:53.000000000 -0400
+++ testing.pod 2005-07-06 15:26:19.000000000 -0400
@@ -1099,8 +1099,8 @@
   my $data = GET_BODY $url;
   
   ok t_cmp(
-           "Amazing!",
            $data,
+           "Amazing!",
            "basic test",
           );
 
@@ -1501,8 +1501,8 @@
   my $expected = "COOL";
   
   ok t_cmp(
-           $expected,
            $received,
+           $expected,
            "testing TestApache::cool",
             );
 
@@ -1740,7 +1740,7 @@
 
 =back
 
-These are two special methods added by the C<Apache::Test> framework:
+These are two special methods added by the C<Apache::TestRequest> framework:
 
 =over
 
@@ -1755,6 +1755,12 @@
 
   UPLOAD $location, filename => $filename, 'X-Header-Test' => 'Test';
 
+This function sends the form data in a POST response. To insert additional
+parameters, append them as 'key' => 'value' elements as in the following
+example:
+
+  UPLOAD $location, filename => $filename, 'my_file_name' => 'Test.txt', 
'username' => 'Captain Kirk', 'password' => 'beam me up';
+
 To upload a string as a file, use:
 
   UPLOAD $location, content => 'some data';
@@ -1986,8 +1992,8 @@
   my $first  = req($same_interp, $url);
   my $second = req($same_interp, $url);
   ok t_cmp(
-      1,
       $first && $second && ($second - $first),
+      1,
       "the closure problem is there",
   );
   sub req {
@@ -2449,19 +2455,19 @@
 be always called no matter whether the first argument will evaluate to
 a true or a false value. For example, if you had a function:
 
-  ok t_cmp($expected, $received, $comment);
+  ok t_cmp($received, $expected, $comment);
 
 and now you want to run this sub-test if module C<HTTP::Date> is
 available, changing it to:
 
   my $should_skip = eval { require HTTP::Date } ? "" : "missing HTTP::Date";
-  skip $should_skip, t_cmp($expected, $received, $comment);
+  skip $should_skip, t_cmp($received, $expected, $comment);
 
 will still run C<t_cmp()> even if C<HTTP::Date> is not
 available. Therefore it's probably better to code it in this way:
 
   if (eval {require HTTP::Date}) {
-      ok t_cmp($expected, $received, $comment);
+      ok t_cmp($received, $expected, $comment);
   }
   else {
       skip "Skip HTTP::Date not found";
@@ -2612,7 +2618,7 @@
 
   eval {foo();}
   if ($@) {
-      ok t_cmp(qr/^expecting foo/, $@, "func eval");
+      ok t_cmp($@, qr/^expecting foo/, "func eval");
   }
 
 which is the same as:

Reply via email to