httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-test/perl-framework/t/modules negotiation.t
Date Sat, 20 Oct 2001 02:22:59 GMT
dougm       01/10/19 19:22:59

  Modified:    perl-framework/t/modules negotiation.t
  Log:
  make workie under win32
  
  Revision  Changes    Path
  1.5       +18 -12    httpd-test/perl-framework/t/modules/negotiation.t
  
  Index: negotiation.t
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/t/modules/negotiation.t,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- negotiation.t	2001/09/18 15:41:03	1.4
  +++ negotiation.t	2001/10/20 02:22:59	1.5
  @@ -44,19 +44,25 @@
       have_module 'negotiation';
   
   my $actual;
  +
  +#XXX: this is silly; need a better way to be portable
  +sub my_chomp {
  +    $actual =~ s/[\r\n]+$//s;
  +}
  +
   foreach (@language) {
   
       ## verify that the correct default language content is returned
       $actual = GET_BODY "/modules/negotiation/$_/";
  -    chomp $actual;
  +    my_chomp();
       ok ($actual eq "index.html.$_");
   
       $actual = GET_BODY "/modules/negotiation/$_/compressed/";
  -    chomp $actual;
  +    my_chomp();
       ok ($actual eq "index.html.$_.gz");
   
       $actual = GET_BODY "/modules/negotiation/$_/two/index";
  -    chomp $actual;
  +    my_chomp();
       ok ($actual eq "index.$_.html");
   
       foreach my $ext (@language) {
  @@ -69,17 +75,17 @@
           ## the Accept-Language header is obeyed when present.
           $actual = GET_BODY "/modules/negotiation/$_/",
               'Accept-Language' => $ext;
  -        chomp $actual;
  +        my_chomp();
           ok ($actual eq "index.html.$ext");
   
           $actual = GET_BODY "/modules/negotiation/$_/compressed/",
               'Accept-Language' => $ext;
  -        chomp $actual;
  +        my_chomp();
           ok ($actual eq "index.html.$ext.gz");
   
           $actual = GET_BODY "/modules/negotiation/$_/two/index",
               'Accept-Language' => $ext;
  -        chomp $actual;
  +        my_chomp();
           ok ($actual eq "index.$ext.html");
   
       }
  @@ -91,32 +97,32 @@
   ## we expect Apache to return the 'fu' content.
   $actual = GET_BODY "/modules/negotiation/$en/",
       'Accept-Language' => "$en; q=0.1, $fr; q=0.4, $fu; q=0.9, $de; q=0.2";
  -chomp $actual;
  +my_chomp();
   ok ($actual eq "index.html.$fu");
   
   $actual = GET_BODY "/modules/negotiation/$en/two/index",
       'Accept-Language' => "$en; q=0.1, $fr; q=0.4, $fu; q=0.9, $de; q=0.2";
  -chomp $actual;
  +my_chomp();
   ok ($actual eq "index.$fu.html");
   
   $actual = GET_BODY "/modules/negotiation/$en/compressed/",
       'Accept-Language' => "$en; q=0.1, $fr; q=0.4, $fu; q=0.9, $de; q=0.2";
  -chomp $actual;
  +my_chomp();
   ok ($actual eq "index.html.$fu.gz");
   
   ## 'bu' has the highest quality rating, but is non-existant,
   ## so we expect the next highest rated 'fr' content to be returned.
   $actual = GET_BODY "/modules/negotiation/$en/",
       'Accept-Language' => "$en; q=0.1, $fr; q=0.4, $bu; q=1.0";
  -chomp $actual;
  +my_chomp();
   ok ($actual eq "index.html.$fr");
   
   $actual = GET_BODY "/modules/negotiation/$en/two/index",
       'Accept-Language' => "$en; q=0.1, $fr; q=0.4, $bu; q=1.0";
  -chomp $actual;
  +my_chomp();
   ok ($actual eq "index.$fr.html");
   
   $actual = GET_BODY "/modules/negotiation/$en/compressed/",
       'Accept-Language' => "$en; q=0.1, $fr; q=0.4, $bu; q=1.0";
  -chomp $actual;
  +my_chomp();
   ok ($actual eq "index.html.$fr.gz");
  
  
  

Mime
View raw message