httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1039903 - /httpd/test/framework/trunk/t/apache/expr.t
Date Sun, 28 Nov 2010 16:42:41 GMT
Author: sf
Date: Sun Nov 28 16:42:41 2010
New Revision: 1039903

URL: http://svn.apache.org/viewvc?rev=1039903&view=rev
Log:
add testcases for ipmatch and strmatch

Modified:
    httpd/test/framework/trunk/t/apache/expr.t

Modified: httpd/test/framework/trunk/t/apache/expr.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/expr.t?rev=1039903&r1=1039902&r2=1039903&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/apache/expr.t (original)
+++ httpd/test/framework/trunk/t/apache/expr.t Sun Nov 28 16:42:41 2010
@@ -125,6 +125,28 @@ my @test_cases = (
     [ q[-z '']  => 1 ],
     [ q[-n '1'] => 1 ],
     [ q[-z '1'] => 0 ],
+    # IP match
+    [ q[-R 'abc']                   => undef ],
+    [ q[-R %{REMOTE_ADDR}]          => undef ],
+    [ q[-R '240.0.0.0']             => 0 ],
+    [ q[-R '240.0.0.0/8']           => 0 ],
+    [ q[-R 'ff::/8']                => 0 ],
+    [ q[-R '127.0.0.1' || -R '::1'] => 1 ],
+    [ q['127.0.0.1' -ipmatch 'abc']          => undef ],
+    [ q['127.0.0.1' -ipmatch %{REMOTE_ADDR}] => undef ],
+    [ q['127.0.0.1' -ipmatch '240.0.0.0']    => 0 ],
+    [ q['127.0.0.1' -ipmatch '240.0.0.0/8']  => 0 ],
+    [ q['127.0.0.1' -ipmatch 'ff::/8']       => 0 ],
+    [ q['127.0.0.1' -ipmatch '127.0.0.0/8']  => 1 ],
+    # fn/strmatch
+    [ q['foo' -strmatch '*o']      => 1 ],
+    [ q['fo/o' -strmatch 'f*']     => 1 ],
+    [ q['foo' -strmatch 'F*']      => 0 ],
+    [ q['foo' -strcmatch 'F*']     => 1 ],
+    [ q['foo' -strmatch 'g*']      => 0 ],
+    [ q['foo' -strcmatch 'g*']     => 0 ],
+    [ q['a/b' -fnmatch 'a*']       => 0 ],
+    [ q['a/b' -fnmatch 'a/*']      => 1 ],
     # error handling
     [ q['%{foo:User-Agent}' != 'bar'] => undef ],
     [ q[%{foo:User-Agent} != 'bar']   => undef ],



Mime
View raw message