You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2004/07/22 23:41:46 UTC

cvs commit: modperl-2.0/t/response/TestAPI request_rec.pm

stas        2004/07/22 14:41:46

  Modified:    t/response/TestAPI request_rec.pm
  Log:
  better $r->method_number and $r->allowed tests
  
  Revision  Changes    Path
  1.21      +12 -4     modperl-2.0/t/response/TestAPI/request_rec.pm
  
  Index: request_rec.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/request_rec.pm,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -u -r1.20 -r1.21
  --- request_rec.pm	9 Jul 2004 08:01:21 -0000	1.20
  +++ request_rec.pm	22 Jul 2004 21:41:46 -0000	1.21
  @@ -12,7 +12,7 @@
   
   use APR::Finfo ();
   
  -use Apache::Const -compile => 'OK';
  +use Apache::Const -compile => qw(OK M_GET M_PUT);
   use APR::Const    -compile => qw(FINFO_NORM);
   
   #this test module is only for testing fields in the request_rec
  @@ -23,7 +23,7 @@
   sub handler {
       my $r = shift;
   
  -    plan $r, tests => 43;
  +    plan $r, tests => 45;
   
       #Apache->request($r); #PerlOptions +GlobalRequest takes care
       my $gr = Apache->request;
  @@ -70,9 +70,17 @@
   
       ok $r->method;
   
  -    ok $r->method_number || 1;
  +    ok t_cmp $r->method_number, Apache::M_GET, "method number";
   
  -    ok $r->allowed || 1;
  +    {
  +        $r->allowed(1 << Apache::M_GET);
  +
  +        ok $r->allowed & (1 << Apache::M_GET);
  +        ok ! ($r->allowed & (1 << Apache::M_PUT));
  +
  +        $r->allowed($r->allowed | (1 << Apache::M_PUT));
  +        ok $r->allowed & (1 << Apache::M_PUT);
  +    }
   
       #allowed_xmethods
       #allow_methods