stas        01/12/05 08:39:01

  Modified:    t/apache compat.t
               t/response/TestApache compat.pm
  Log:
  - add the rest of the sub tests for the $r methods provided by
  Apache::File in 1.x.
  
  Revision  Changes    Path
  1.6       +3 -3      modperl-2.0/t/apache/compat.t
  
  Index: compat.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/apache/compat.t,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- compat.t  2001/12/05 16:03:25     1.5
  +++ compat.t  2001/12/05 16:39:01     1.6
  @@ -6,7 +6,7 @@
   use Apache::TestUtil;
   use Apache::TestRequest;
   
  -plan tests => 21, \&have_lwp;
  +plan tests => 26, \&have_lwp;
   
   my $location = "/TestApache::compat";
   
  @@ -54,7 +54,7 @@
   
   # Apache::File
   {
  -    my @data = (test => 'file');
  +    my @data = (test => 'Apache::File');
       my $data = GET_BODY query(@data) || '';
       ok_nok($data);
   }
  @@ -66,7 +66,7 @@
       "$location?" . join '&', map { "$_=$args{$_}" } keys %args;
   }
   
  -sub t_header{
  +sub t_header {
       my ($way, $what, $comment) = @_;
       ok t_cmp(
           "ok",
  
  
  
  1.5       +25 -3     modperl-2.0/t/response/TestApache/compat.pm
  
  Index: compat.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- compat.pm 2001/12/05 16:03:25     1.4
  +++ compat.pm 2001/12/05 16:39:01     1.5
  @@ -77,7 +77,7 @@
               $r->print(t_is_equal($exp, $got) ? 'ok' : 'nok');
           }
       }
  -    elsif ($data{test} eq 'file') {
  +    elsif ($data{test} eq 'Apache::File') {
           $gr = $r;
           my $file = $vars->{t_conf_file};
   
  @@ -118,7 +118,7 @@
   
           # tmpfile
           my ($tmpfile, $tmpfh) = Apache::File->tmpfile;
  -#89573612
  +
           debug "open tmpfile fh";
           ok $tmpfh;
   
  @@ -131,9 +131,31 @@
           seek $tmpfh, 0, 0;
           my $read = <$tmpfh>;
           ok $read eq $write;
  +
  +        debug "\$r->discard_request_body";
  +        ok $r->discard_request_body == Apache::OK;
  +
  +        debug "\$r->meets_conditions";
  +        ok $r->meets_conditions == Apache::OK;
  +
  +        debug "\$r->set_content_length";
  +        $r->set_content_length(10);
  +        my $cl_header = $r->headers_out->{"Content-length"} || '';
  +        ok $cl_header == 10;
  +
  +        # XXX: how to test etag?
  +        debug "\$r->set_etag";
  +        $r->set_etag;
  +        ok 1;
  +
  +        debug "\$r->update_mtime/\$r->mtime";
  +        my $time = time;
  +        $r->update_mtime($time);
  +        ok $r->mtime == $time;
  +
       }
   
  -    OK;
  +    Apache::OK;
   }
   
   sub ok    { $gr->print($_[0] ? "ok\n" : "nok\n"); }
  
  
  


Reply via email to