httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: httpd-test/perl-framework/t/modules rewrite.t
Date Wed, 29 May 2002 03:22:57 GMT
jwoolley    02/05/28 20:22:57

  Modified:    perl-framework/t/conf extra.conf.in
               perl-framework/t/modules rewrite.t
  Added:       perl-framework/t/htdocs/modules/rewrite append.pl.PL
                        barfoo.html
  Log:
  Add a test for prg: rewritemaps that take an argument.  Note that
  getting RewriteMap prg:'s to work requires RewriteEngine to be on
  at the global context.
  
  Revision  Changes    Path
  1.39      +5 -0      httpd-test/perl-framework/t/conf/extra.conf.in
  
  Index: extra.conf.in
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/t/conf/extra.conf.in,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -d -u -r1.38 -r1.39
  --- extra.conf.in	9 May 2002 09:57:31 -0000	1.38
  +++ extra.conf.in	29 May 2002 03:22:56 -0000	1.39
  @@ -117,6 +117,7 @@
   ##
   
   <IfModule mod_rewrite.c>
  +    RewriteEngine On
       RewriteLog @SERVERROOT@/logs/rewrite_log
       RewriteLogLevel 9
       RewriteLock @SERVERROOT@/logs/rewrite_lock
  @@ -124,6 +125,7 @@
       RewriteMap numbers-rnd rnd:@SERVERROOT@/htdocs/modules/rewrite/numbers.rnd
       #RewriteMap numbers-dbm dbm:@SERVERROOT@/htdocs/modules/rewrite/numbers.dbm
       RewriteMap numbers-prg prg:@SERVERROOT@/htdocs/modules/rewrite/numbers.pl
  +    RewriteMap appendfoo "prg:@SERVERROOT@/htdocs/modules/rewrite/append.pl foo"
       RewriteMap lower int:tolower
   
       <Directory @SERVERROOT@/htdocs/modules/rewrite>
  @@ -158,6 +160,9 @@
           RewriteRule ^([1-6])$ ${numbers-dbm:$1}.html [S=1]
           RewriteCond %{ENV:MAPTYPE} =prg
           RewriteRule ^([1-6])$ ${numbers-prg:$1}.html [L]
  +
  +        RewriteRule ^(bar).html$ ${appendfoo:$1}.html [L]
  +
       </Directory>
   </IfModule>
   
  
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/rewrite/append.pl.PL
  
  Index: append.pl.PL
  ===================================================================
  
  # append.pl
  #
  #  appends its command line argument to each line of stdin
  #  used to test a rewritemap prg: with args
  #
  $|=1;
  while (<STDIN>) {
      chomp;
      print "$_$ARGV[0]\n";
  }
  
  
  
  1.1                  httpd-test/perl-framework/t/htdocs/modules/rewrite/barfoo.html
  
  Index: barfoo.html
  ===================================================================
  pass
  
  
  
  1.7       +8 -1      httpd-test/perl-framework/t/modules/rewrite.t
  
  Index: rewrite.t
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/t/modules/rewrite.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -d -u -r1.6 -r1.7
  --- rewrite.t	21 Oct 2001 17:46:40 -0000	1.6
  +++ rewrite.t	29 May 2002 03:22:57 -0000	1.7
  @@ -3,6 +3,7 @@
   
   use Apache::Test;
   use Apache::TestRequest;
  +use Apache::TestUtil;
   
   ## mod_rewrite tests
   ##
  @@ -13,7 +14,7 @@
   my @url = qw(forbidden gone perm temp 313);
   my $r;
   
  -plan tests => @map * @num + 3, have_module 'rewrite';
  +plan tests => @map * @num + 4, have_module 'rewrite';
   
   foreach (@map) {
       foreach my $n (@num) {
  @@ -51,3 +52,9 @@
   chomp $r;
   $r =~ s/\r//g;
   ok ($r eq "JACKPOT");
  +
  +chomp ($r = GET_BODY("/modules/rewrite/bar.html"));
  +ok t_cmp("pass",
  +         $r,
  +         "prg: map with arguments"
  +        );
  
  
  

Mime
View raw message