httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: httpd-test/perl-framework/t/filter case.t case_in.t
Date Sat, 07 Aug 2004 03:12:33 GMT
stas        2004/08/06 20:12:33

  Modified:    perl-framework/t/filter case.t case_in.t
  Log:
  avoid the bad practice of passing $_ to an external function within
  foreach loop without localizing $_
  
  Revision  Changes    Path
  1.7       +9 -9      httpd-test/perl-framework/t/filter/case.t
  
  Index: case.t
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/t/filter/case.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -u -r1.6 -r1.7
  --- case.t	7 Aug 2004 02:15:50 -0000	1.6
  +++ case.t	7 Aug 2004 03:12:33 -0000	1.7
  @@ -14,22 +14,22 @@
   
   my @filter = ('X-AddOutputFilter' => 'CaseFilter'); #mod_client_add_filter
   
  -my %modules = map { $_, have_module($_) } keys %urls;
  +for my $module (keys %urls) {
  +    delete $urls{$module} unless have_module($module);
  +}
   
  -my $tests = 1 + grep { $modules{$_} } keys %urls;
  +my $tests = 1 + scalar keys %urls;
   
   plan tests => $tests, need_module 'case_filter';
   
   verify(GET '/', @filter);
   
   for my $module (sort keys %urls) {
  -    if ($modules{$module}) {
  -        my $r = GET $urls{$module}, @filter;
  -        print "# testing $module with $urls{$module}\n";
  -        print "# expected 200\n";
  -        print "# received ".$r->code."\n";
  -        verify($r);
  -    }
  +    my $r = GET $urls{$module}, @filter;
  +    print "# testing $module with $urls{$module}\n";
  +    print "# expected 200\n";
  +    print "# received ".$r->code."\n";
  +    verify($r);
   }
   
   sub verify {
  
  
  
  1.5       +9 -9      httpd-test/perl-framework/t/filter/case_in.t
  
  Index: case_in.t
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/t/filter/case_in.t,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -u -r1.4 -r1.5
  --- case_in.t	4 Aug 2004 15:44:08 -0000	1.4
  +++ case_in.t	7 Aug 2004 03:12:33 -0000	1.5
  @@ -13,9 +13,11 @@
   
   my @filter = ('X-AddInputFilter' => 'CaseFilterIn'); #mod_client_add_filter
   
  -my %modules = map { $_, Apache::Test::have_module($_) } keys %urls;
  +for my $module (keys %urls) {
  +    delete $urls{$module} unless have_module($module);
  +}
   
  -my $tests = 1 + grep { $modules{$_} } keys %urls;
  +my $tests = 1 + scalar keys %urls;
   
   plan tests => $tests, need_module 'case_filter_in';
   
  @@ -24,13 +26,11 @@
   my $data = "v1=one&v3=two&v2=three";
   
   for my $module (sort keys %urls) {
  -    if ($modules{$module}) {
  -        my $r = POST $urls{$module}, @filter, content => $data;
  -        print "# testing $module with $urls{$module}\n";
  -        print "# expected 200\n";
  -        print "# received ".$r->code."\n";
  -        verify($r);
  -    }
  +    my $r = POST $urls{$module}, @filter, content => $data;
  +    print "# testing $module with $urls{$module}\n";
  +    print "# expected 200\n";
  +    print "# received ".$r->code."\n";
  +    verify($r);
   }
   
   sub verify {
  
  
  

Mime
View raw message