joes        2003/06/13 02:46:52

  Modified:    glue/perl/t TEST.PL
               glue/perl/t/apreq big_input.t cookie.t inherit.t request.t
               glue/perl/t/response/TestApReq inherit.pm request.pm
  Log:
  Update perl tests- all pass save for the upload test,
  which is marked as a todo test.
  
  Revision  Changes    Path
  1.3       +2 -0      httpd-apreq-2/glue/perl/t/TEST.PL
  
  Index: TEST.PL
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/TEST.PL,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TEST.PL   12 Jun 2003 05:42:13 -0000      1.2
  +++ TEST.PL   13 Jun 2003 09:46:52 -0000      1.3
  @@ -4,6 +4,8 @@
   use warnings FATAL => 'all';
   
   use lib qw(lib Apache-Test/lib);
  +
  +use Apache2;
   use Apache::Build;
   require Win32 if Apache::Build::WIN32;
   
  
  
  
  1.2       +1 -0      httpd-apreq-2/glue/perl/t/apreq/big_input.t
  
  Index: big_input.t
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/apreq/big_input.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- big_input.t       9 Jun 2003 06:30:04 -0000       1.1
  +++ big_input.t       13 Jun 2003 09:46:52 -0000      1.2
  @@ -1,3 +1,4 @@
  +#!/usr/bin/perl
   use strict;
   use warnings FATAL => 'all';
   
  
  
  
  1.2       +1 -0      httpd-apreq-2/glue/perl/t/apreq/cookie.t
  
  Index: cookie.t
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/apreq/cookie.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- cookie.t  9 Jun 2003 06:30:04 -0000       1.1
  +++ cookie.t  13 Jun 2003 09:46:52 -0000      1.2
  @@ -1,3 +1,4 @@
  +#!/usr/bin/perl
   use strict;
   use warnings FATAL => 'all';
   
  
  
  
  1.2       +3 -2      httpd-apreq-2/glue/perl/t/apreq/inherit.t
  
  Index: inherit.t
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/apreq/inherit.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- inherit.t 9 Jun 2003 06:30:04 -0000       1.1
  +++ inherit.t 13 Jun 2003 09:46:52 -0000      1.2
  @@ -1,3 +1,4 @@
  +#!/usr/bin/perl
   use strict;
   use warnings FATAL => 'all';
   
  @@ -8,7 +9,7 @@
   
   plan tests => 1;
   my $location = "/TestApReq__inherit";
  -ok t_cmp(<< 'VALUE', GET_BODY($location), "inheritance");
  +ok t_cmp(<< 'VALUE', $_=GET_BODY($location), "inheritance");
   method => GET
   VALUE
  -
  +warn $_;
  
  
  
  1.2       +2 -1      httpd-apreq-2/glue/perl/t/apreq/request.t
  
  Index: request.t
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/apreq/request.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- request.t 9 Jun 2003 06:30:04 -0000       1.1
  +++ request.t 13 Jun 2003 09:46:52 -0000      1.2
  @@ -1,3 +1,4 @@
  +#!/usr/bin/perl
   use strict;
   use warnings FATAL => 'all';
   
  @@ -6,7 +7,7 @@
   use Apache::TestUtil;
   use Apache::TestRequest qw(GET_BODY UPLOAD_BODY);
   
  -plan tests => 2;
  +plan tests => 2, todo => [2];
   
   my $location = "/TestApReq__request";
   #print GET_BODY $location;
  
  
  
  1.2       +13 -8     httpd-apreq-2/glue/perl/t/response/TestApReq/inherit.pm
  
  Index: inherit.pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/response/TestApReq/inherit.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- inherit.pm        9 Jun 2003 04:00:45 -0000       1.1
  +++ inherit.pm        13 Jun 2003 09:46:52 -0000      1.2
  @@ -1,14 +1,19 @@
   package TestApReq::inherit;
  +use base 'Apache::Request';
   use strict;
  -use Apache::Request;
  -use Apache::Constants qw/OK/;
  +use warnings FATAL => 'all';
  +use APR;
  +use Apache::RequestRec;
  +use Apache::RequestIO;
  +use Devel::Peek;
   sub handler {
  -    my $r = Apache->request;
  -    $r->send_http_header('text/plain');
  -
  -    my $apr = Apache::Request->new($r);
  -    printf "method => %s\n", $apr->method;
  -    return OK;
  +    my $r = shift;
  +    $r->content_type('text/plain');
  +    $r = __PACKAGE__->new($r); # tickles refcnt bug in apreq-1
  +    Dump($r);
  +    die "Wrong package: ", ref $r unless $r->isa('TestApReq::inherit');
  +    $r->print(sprintf "method => %s\n", $r->method);
  +    return 0;
   }
   
   1;
  
  
  
  1.2       +8 -9      httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm
  
  Index: request.pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- request.pm        9 Jun 2003 04:00:45 -0000       1.1
  +++ request.pm        13 Jun 2003 09:46:52 -0000      1.2
  @@ -2,28 +2,27 @@
   
   use strict;
   use warnings FATAL => 'all';
  -
  -use Apache::Test;
  -use Apache::TestUtil;
  -use Apache::Constants qw(OK M_POST DECLINED);
  -
  +use APR;
  +use Apache::RequestRec;
  +use Apache::RequestIO;
   use Apache::Request ();
   
   sub handler {
       my $r = shift;
       my $apr = Apache::Request->new($r);
   
  -    $r->send_http_header('text/plain');
  +    $r->content_type('text/plain');
   
       my $test  = $apr->param('test');
       my $value = $apr->param('value');
   
  -    return DECLINED unless defined $test;
  +#   return DECLINED unless defined $test;
   
       if ($test eq 'param') {
           $r->print($value);
       }
       elsif ($test eq 'upload') {
  +        return -1;
           my $upload = $apr->upload;
           my $fh = $upload->fh;
           local $/;
  @@ -31,10 +30,10 @@
           $r->print($data);
       } 
       else {
  -        
  +
       }
   
  -    return OK;
  +    return 0;
   }
   1;
   __END__
  
  
  

Reply via email to