perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r209502 - /perl/modperl/docs/trunk/src/docs/general/testing/testing.pod
Date Wed, 06 Jul 2005 19:34:02 GMT
Author: stas
Date: Wed Jul  6 12:34:00 2005
New Revision: 209502

URL: http://svn.apache.org/viewcvs?rev=209502&view=rev
Log:
- updated all the t_cmp() examples to indicate the new format of received, 
expected, comment.
- documented other UPLOAD options
Contributed by: William McKee <william@knowmad.com>

Modified:
    perl/modperl/docs/trunk/src/docs/general/testing/testing.pod

Modified: perl/modperl/docs/trunk/src/docs/general/testing/testing.pod
URL: http://svn.apache.org/viewcvs/perl/modperl/docs/trunk/src/docs/general/testing/testing.pod?rev=209502&r1=209501&r2=209502&view=diff
==============================================================================
--- perl/modperl/docs/trunk/src/docs/general/testing/testing.pod (original)
+++ perl/modperl/docs/trunk/src/docs/general/testing/testing.pod Wed Jul  6 12:34:00 2005
@@ -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",
             );
 
@@ -1755,6 +1755,10 @@
 
   UPLOAD $location, filename => $filename, 'X-Header-Test' => 'Test';
 
+Or additional parameters:
+
+  UPLOAD $location, filename => $filename, 'username' => 'Captain Kirk', 'password'
=> 'beam me up';
+
 To upload a string as a file, use:
 
   UPLOAD $location, content => 'some data';
@@ -1986,8 +1990,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 +2453,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 +2616,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:



---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org


Mime
View raw message