[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-test-cvs
Subject:    cvs commit: httpd-test/perl-framework/t/modules negotiation.t
From:       dougm () apache ! org
Date:       2001-10-20 2:22:59
[Download RAW message or body]

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");
  
  
  

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic