You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Martín Ferrari <ma...@gmail.com> on 2013/03/12 02:59:55 UTC
Wrong code example in /docs/general/testing/testing.html
Hi,
I was trying to set up a test environment for a mod_perl module, and
-among many other problems I had with the docs, that I'll try to put
in other reports-, I've found some code that does not even compile,
and is missing required modules, under
http://perl.apache.org/docs/general/testing/testing.html#Developing_Response_only_Part_of_a_Test
The patch I manually generated (I don't have the sources for the docs):
@@ -1,21 +1,23 @@
#file:t/response/TestApache/write.pm
#-----------------------------------
package TestApache::write;
use strict;
use warnings FATAL => 'all';
use constant BUFSIZ => 512; #small for testing
use Apache2::Const -compile => 'OK';
+use Apache2::RequestIO;
+use Apache2::RequestRec;
sub handler {
my $r = shift;
$r->content_type('text/plain');
$r->write("1..2\n");
- $r->write("ok 1")
- $r->write("not ok 2")
+ $r->write("ok 1");
+ $r->write("not ok 2");
Apache2::Const::OK;
}
1;
--
Martín Ferrari
Re: Wrong code example in /docs/general/testing/testing.html
Posted by Fred Moyer <fr...@redhotpenguin.com>.
Thanks for the spot, update committed.
On Mon, Mar 18, 2013 at 9:51 AM, Torsten Förtsch
<to...@gmx.net> wrote:
> On 03/12/2013 02:59 AM, Martín Ferrari wrote:
>> + $r->write("ok 1");
>> + $r->write("not ok 2");
>
> I think it should read (missing \n):
>
> + $r->write("ok 1\n");
> + $r->write("not ok 2\n");
>
>
> Torsten
Re: Wrong code example in /docs/general/testing/testing.html
Posted by Torsten Förtsch <to...@gmx.net>.
On 03/12/2013 02:59 AM, Martín Ferrari wrote:
> + $r->write("ok 1");
> + $r->write("not ok 2");
I think it should read (missing \n):
+ $r->write("ok 1\n");
+ $r->write("not ok 2\n");
Torsten
Re: Wrong code example in /docs/general/testing/testing.html
Posted by Fred Moyer <fr...@redhotpenguin.com>.
Thanks, change applied r1457851.
On Mon, Mar 11, 2013 at 6:59 PM, Martín Ferrari
<ma...@gmail.com> wrote:
> Hi,
>
> I was trying to set up a test environment for a mod_perl module, and
> -among many other problems I had with the docs, that I'll try to put
> in other reports-, I've found some code that does not even compile,
> and is missing required modules, under
> http://perl.apache.org/docs/general/testing/testing.html#Developing_Response_only_Part_of_a_Test
>
> The patch I manually generated (I don't have the sources for the docs):
>
> @@ -1,21 +1,23 @@
> #file:t/response/TestApache/write.pm
> #-----------------------------------
> package TestApache::write;
>
> use strict;
> use warnings FATAL => 'all';
>
> use constant BUFSIZ => 512; #small for testing
> use Apache2::Const -compile => 'OK';
> +use Apache2::RequestIO;
> +use Apache2::RequestRec;
>
> sub handler {
> my $r = shift;
> $r->content_type('text/plain');
>
> $r->write("1..2\n");
> - $r->write("ok 1")
> - $r->write("not ok 2")
> + $r->write("ok 1");
> + $r->write("not ok 2");
>
> Apache2::Const::OK;
> }
> 1;
>
>
> --
> Martín Ferrari