stas        2003/09/17 23:36:33

  Modified:    t/modules cgi.t
  Log:
  skip only the upload sub-test if LWP is not available, the rest can run
  just fine with Apache::TestClient
  
  Revision  Changes    Path
  1.9       +13 -5     modperl-2.0/t/modules/cgi.t
  
  Index: cgi.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/modules/cgi.t,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -u -r1.8 -r1.9
  --- cgi.t     18 Sep 2003 06:28:19 -0000      1.8
  +++ cgi.t     18 Sep 2003 06:36:33 -0000      1.9
  @@ -7,7 +7,13 @@
   use Apache::Build ();
   
   my $build = Apache::Build->build_config;
  -plan tests => 5, have 'LWP',
  +
  +use constant HAVE_LWP => have_lwp();
  +
  +my $tests = 4;
  +$tests += 1 if HAVE_LWP;
  +
  +plan tests => $tests, have
       {"MP_COMPAT_1X is disabled" => $build->{MP_COMPAT_1X}};
   
   my $module = 'TestModules::cgi';
  @@ -28,10 +34,12 @@
       t_cmp("ok 3", $str, "POST $location\n$content");
   };
   
  -sok {
  -    $str = UPLOAD_BODY $location, content => 4;
  -    t_cmp("ok 4", $str, 'file upload');
  -};
  +if (HAVE_LWP) {
  +    sok {
  +        $str = UPLOAD_BODY $location, content => 4;
  +        t_cmp("ok 4", $str, 'file upload');
  +    };
  +}
   
   sok {
       my $header = 'Content-type';
  
  
  

Reply via email to