stas        2003/08/27 18:58:32

  Modified:    t/response/TestAPR perlio.pm
               t/apr-ext perlio.t
  Log:
  it should be fine by now to 'require APR::Perlio', without needing an
  eval. the problem with eval {} is that it hides possible loading
  problems, which shouldn't be there.
  
  Revision  Changes    Path
  1.23      +4 -9      modperl-2.0/t/response/TestAPR/perlio.pm
  
  Index: perlio.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/perlio.pm,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -u -r1.22 -r1.23
  --- perlio.pm 22 Aug 2003 19:15:08 -0000      1.22
  +++ perlio.pm 28 Aug 2003 01:58:32 -0000      1.23
  @@ -23,15 +23,10 @@
   
       $tests += $lfs_tests unless LARGE_FILES_CONFLICT;
   
  -    # 1) APR::PerlIO is not available on all platforms
  -    # 2) on those platforms where available,
  -    #    PerlIO-enabled perl is needed to run this test
  -    my $run = eval { require APR::PerlIO } && 
  -        APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED()
  -            ? 1
  -            : have  { "This Perl build doesn't support PerlIO layers" => 0 };
  -
  -    plan $r, tests => $tests, $run;
  +    require APR::PerlIO;
  +    plan $r, tests => $tests,
  +        have  { "This Perl build doesn't support PerlIO layers" =>
  +                    APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED() };
   
       my $vars = Apache::Test::config()->{vars};
       my $dir  = catfile $vars->{documentroot}, "perlio";
  
  
  
  1.3       +11 -6     modperl-2.0/t/apr-ext/perlio.t
  
  Index: perlio.t
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/apr-ext/perlio.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- perlio.t  22 Aug 2003 19:15:08 -0000      1.2
  +++ perlio.t  28 Aug 2003 01:58:32 -0000      1.3
  @@ -30,17 +30,22 @@
   my $has_apr_config = $build->{apr_config_path} && 
       !$build->httpd_is_source_tree;
   
  +my $has_perlio_layers = 0;
  +if ($has_apr_config) {
  +    require APR;
  +    require APR::PerlIO;
  +    $has_perlio_layers = 1 if APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED();
  +}
  +
   my $tests = 12;
   my $lfs_tests = 3;
   
   $tests += $lfs_tests unless LARGE_FILES_CONFLICT;
  -
  +require APR; require APR::PerlIO;
   plan tests => $tests,
  -    have {"the build couldn't find apr-config" => $has_apr_config,
  -          "This Perl build doesn't support PerlIO layers" => 
  -              (eval { require APR; require APR::PerlIO } && 
  -               APR::PerlIO::PERLIO_LAYERS_ARE_ENABLED()),
  -          };
  +    have {"this build couldn't find apr-config"      => $has_apr_config,
  +          "this build doesn't support PerlIO layers" => $has_perlio_layers,
  +    };
   
   require APR::Pool;
   
  
  
  

Reply via email to