Author: joes
Date: Wed Oct 12 20:22:22 2005
New Revision: 320619
URL: http://svn.apache.org/viewcvs?rev=320619&view=rev
Log:
add some doc tests
Modified:
httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pod
Modified: httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pod
URL:
http://svn.apache.org/viewcvs/httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pod?rev=320619&r1=320618&r2=320619&view=diff
==============================================================================
--- httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pod (original)
+++ httpd/apreq/trunk/glue/perl/xsbuilder/APR/Request/Param/Param.pod Wed Oct
12 20:22:22 2005
@@ -57,6 +57,8 @@
ok $_->isa("APR::Request::Param") for values %$body;
@uploads = grep {$_->upload} values %$body;
+ $param = $body->get('beta');
+ $param->upload_slurp(my $content);
=for example end
@@ -64,7 +66,7 @@
=for example_testing
is $arg1, "arg1", 'alpha arg is "arg1"';
ok @uploads == 1;
-
+ is $content, "second", 'contents of upload_slurp';
@@ -93,6 +95,13 @@
The double-quote interpolation operator maps to
C<< APR::Request::Param::value() >>.
+=for example begin
+
+=for example end
+
+=for example_testing
+ is "$param", $param->value, "quotes";
+
@@ -110,6 +119,13 @@
Returns the param's name.
This attribute cannot be modified.
+=for example begin
+
+=for example end
+
+=for example_testing
+ is $param->name, "beta", "name";
+
@@ -120,6 +136,13 @@
Returns the param's value.
This attribute cannot be modified.
+=for example begin
+
+=for example end
+
+=for example_testing
+ is $param->value, "foo.txt", "value";
+
@@ -134,6 +157,19 @@
this also activates the SvUTF8_on flag during calls
to name() and/or value().
+=for example begin
+
+ $tainted = $param->is_tainted;
+ $param->is_tainted(0);
+ ok $param->is_tainted == 0;
+
+=for example end
+
+=for example_testing
+ $param->is_tainted($tainted);
+ is $param->is_tainted, $tainted, "tainted";
+
+
=head2 charset
@@ -160,6 +196,18 @@
See L<is_tainted> above for info about how APREQ_CHARSET_UTF8
relates to perl's UTF-8 flag.
+=for example begin
+
+ $charset = $param->charset;
+ $param->charset(2);
+ ok $param->charset == 2;
+
+=for example end
+
+=for example_testing
+ $param->charset($charset);
+ is $param->charset, $charset, "charset";
+
@@ -262,7 +310,7 @@
=head2 upload_fh
- $param->upload_fh
+ $param->upload_fh()
Returns a seekable filehandle representing the file-upload content.
@@ -292,11 +340,14 @@
provides syntactic sugar for using perl's builtin C<read>, C<readline>,
and C<< <> >> operations on handles tied to this package:
+=for example begin
+
use Symbol;
$fh = gensym;
- tie *$fh, "APR::Request:Brigade", $bb;
+ tie *$fh, "APR::Request::Brigade", $bb;
print while <$fh>;
+=for example end