You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2022/05/10 11:43:44 UTC

svn commit: r1900779 - in /httpd/test/framework/trunk/t: conf/extra.conf.in modules/sed.t

Author: covener
Date: Tue May 10 11:43:44 2022
New Revision: 1900779

URL: http://svn.apache.org/viewvc?rev=1900779&view=rev
Log:
basic sed input test


Modified:
    httpd/test/framework/trunk/t/conf/extra.conf.in
    httpd/test/framework/trunk/t/modules/sed.t

Modified: httpd/test/framework/trunk/t/conf/extra.conf.in
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/conf/extra.conf.in?rev=1900779&r1=1900778&r2=1900779&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Tue May 10 11:43:44 2022
@@ -1462,6 +1462,11 @@ LimitRequestFields    32
 <IfModule mod_sed.c>
   AliasMatch /apache/sed/[^/]+/(.*) @DocumentRoot@/$1
 
+  <Location /apache/sed-echo>
+    SetHandler echo_post
+    SetInputFilter sed 
+  </Location>
+
   <Location /apache/sed/>
     AddOutputFilter sed .html
   </Location>
@@ -1469,6 +1474,11 @@ LimitRequestFields    32
   <Location /apache/sed/out-foo>
       OutputSed "s/foo/bar/g"
   </Location>
+
+  <Location /apache/sed-echo/>
+    InputSed "s/foo/bar/g"
+  </Location>
+
 </IfModule>
 
 

Modified: httpd/test/framework/trunk/t/modules/sed.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/sed.t?rev=1900779&r1=1900778&r2=1900779&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/modules/sed.t (original)
+++ httpd/test/framework/trunk/t/modules/sed.t Tue May 10 11:43:44 2022
@@ -7,7 +7,8 @@ use Apache::TestUtil;
 
 my @ts = (
    # see t/conf/extra.conf.in
-   { url => "/apache/sed/out-foo/foobar.html", content => 'barbar', msg => "sed output filter", code => 200 }
+   { url => "/apache/sed/out-foo/foobar.html", content => 'barbar', msg => "sed output filter", code => 200 },
+   { url => "/apache/sed-echo/echo.html", content => 'barbar', msg => "sed input filter", code => 200, body=>"foobar" }
 );
 
 my $tests = 2*scalar @ts;
@@ -16,7 +17,13 @@ plan tests => $tests, need_module('sed')
 
 
 for my $t (@ts) {
-  my $req = GET $t->{'url'};
+  my $req;
+  if (defined($t->{'body'})) { 
+    $req = POST  $t->{'url'}, content => $t->{'body'};
+  }
+  else { 
+    $req = GET $t->{'url'};
+  }
   ok t_cmp($req->code, $t->{'code'}, "status code for " . $t->{'url'});
   my $content = $req->content;
   chomp($content);