Author: bdelacretaz
Date: Wed Dec  7 14:45:31 2016
New Revision: 1773091

URL: http://svn.apache.org/viewvc?rev=1773091&view=rev
Log:
SLING-6350 - testSymmetry added

Modified:
    
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/resource/path/PathTest.java

Modified: 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/resource/path/PathTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/test/java/org/apache/sling/api/resource/path/PathTest.java?rev=1773091&r1=1773090&r2=1773091&view=diff
==============================================================================
--- 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/resource/path/PathTest.java
 (original)
+++ 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/resource/path/PathTest.java
 Wed Dec  7 14:45:31 2016
@@ -74,6 +74,36 @@ public class PathTest {
         );
     }
 
+    @Test public void testSymmetry() {
+        final String glob = "glob:/apps/**/*.html";
+        
+        final String [] matching = {
+            "/apps/project/a.html", 
+            "/apps/project/1/a.html",
+            "/apps/project/1/2/a.html",
+            "/apps/project/1/2/3/4/5/6/7/8/9/a.html"
+        };
+        
+        final String [] nonMatching = {
+            "/apps/a.html",
+            "/apps/project/a.html/b"
+        };
+        
+        assertMatch(new Path(glob), matching);
+        assertNoMatch(new Path(glob), nonMatching);
+        
+        // TODO this would demonstrate that matching is symmetric, but it's not
+//        for(String s : matching) {
+//            final Path p = new Path(s);
+//            assertMatch(p, glob);
+//        }
+//        
+//        for(String s : nonMatching) {
+//            final Path p = new Path(s);
+//            assertNoMatch(p, glob);
+//        }
+    }
+    
     @Test public void testPatternMatchingA() {
         final Path p = new Path("glob:/apps/**/*.html");
         


Reply via email to