You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2018/10/20 06:51:34 UTC
svn commit: r1844394 - in /httpd/test/framework/trunk/t: conf/
htdocs/modules/speling/ htdocs/modules/speling/caseonly/
htdocs/modules/speling/nocase/ modules/
Author: jailletc36
Date: Sat Oct 20 06:51:34 2018
New Revision: 1844394
URL: http://svn.apache.org/viewvc?rev=1844394&view=rev
Log:
Basic tests for mod_speling
Added:
httpd/test/framework/trunk/t/htdocs/modules/speling/
httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/
httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/good.html
httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several1.html
httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several2.html
httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/
httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/good.html
httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several1.html
httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several2.html
httpd/test/framework/trunk/t/modules/speling.t
Modified:
httpd/test/framework/trunk/t/conf/extra.conf.in
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=1844394&r1=1844393&r2=1844394&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/conf/extra.conf.in (original)
+++ httpd/test/framework/trunk/t/conf/extra.conf.in Sat Oct 20 06:51:34 2018
@@ -1292,3 +1292,13 @@ LimitRequestFields 32
SetOutputFilter DATA
</Directory>
</IfModule>
+
+<IfModule mod_speling.c>
+ <Directory @SERVERROOT@/htdocs/modules/speling/nocase/>
+ CheckSpelling on
+ </Directory>
+ <Directory @SERVERROOT@/htdocs/modules/speling/caseonly/>
+ CheckSpelling on
+ CheckCaseOnly on
+ </Directory>
+</IfModule>
Added: httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/good.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/good.html?rev=1844394&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/good.html (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/good.html Sat Oct 20 06:51:34 2018
@@ -0,0 +1 @@
+<html></html
Added: httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several1.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several1.html?rev=1844394&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several1.html (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several1.html Sat Oct 20 06:51:34 2018
@@ -0,0 +1 @@
+<html></html
Added: httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several2.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several2.html?rev=1844394&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several2.html (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/speling/caseonly/several2.html Sat Oct 20 06:51:34 2018
@@ -0,0 +1 @@
+<html></html
Added: httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/good.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/good.html?rev=1844394&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/good.html (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/good.html Sat Oct 20 06:51:34 2018
@@ -0,0 +1 @@
+<html></html
Added: httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several1.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several1.html?rev=1844394&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several1.html (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several1.html Sat Oct 20 06:51:34 2018
@@ -0,0 +1 @@
+<html></html
Added: httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several2.html
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several2.html?rev=1844394&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several2.html (added)
+++ httpd/test/framework/trunk/t/htdocs/modules/speling/nocase/several2.html Sat Oct 20 06:51:34 2018
@@ -0,0 +1 @@
+<html></html
Added: httpd/test/framework/trunk/t/modules/speling.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/modules/speling.t?rev=1844394&view=auto
==============================================================================
--- httpd/test/framework/trunk/t/modules/speling.t (added)
+++ httpd/test/framework/trunk/t/modules/speling.t Sat Oct 20 06:51:34 2018
@@ -0,0 +1,51 @@
+use strict;
+use warnings FATAL => 'all';
+
+use Apache::Test;
+use Apache::TestUtil;
+use Apache::TestRequest;
+
+my @testcasespaths = (
+ ['/modules/speling/nocase/'],
+ ['/modules/speling/caseonly/'],
+);
+
+my @testcases = (
+ ## File Test CheckCaseOnly Off On
+ ['good.html', "normal", 200, 200],
+ ['god.html', "omission", 301, 404],
+ ['goood.html', "insertion", 301, 404],
+ ['godo.html', "transposition", 301, 404],
+ ['go_d.html', "wrong character", 301, 404],
+ ['GOOD.html', "case", 301, 301],
+
+ ['good.wrong_ext', "wrong extension", 300, 300],
+ ['GOOD.wrong_ext', "NC wrong extension", 300, 300],
+
+ ['Bad.html', "wrong filename", 404, 404],
+ ['dogo.html', "double transposition", 404, 404],
+ ['XooX.html', "double wrong character", 404, 404],
+
+ ['several0.html', "multiple choise", 300, 404],
+);
+
+plan tests => scalar @testcasespaths * scalar @testcases, need 'mod_speling';
+
+my $r;
+my $code = 2;
+
+# disable redirect
+local $Apache::TestRequest::RedirectOK = 0;
+
+foreach my $p (@testcasespaths) {
+ foreach my $t (@testcases) {
+ ##
+ $r = GET($p->[0] . $t->[0]);
+ print $r->content;
+
+ # Checking for return code
+ ok t_cmp($r->code, $t->[$code], "Checking " . $t->[1] . ". Expecting: ". $t->[$code]);
+ }
+
+ $code = $code+1;
+}