Author: cziegeler
Date: Sat Oct 15 14:56:51 2016
New Revision: 1765081
URL: http://svn.apache.org/viewvc?rev=1765081&view=rev
Log:
Add test for trailing path
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=1765081&r1=1765080&r2=1765081&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
Sat Oct 15 14:56:51 2016
@@ -18,11 +18,11 @@
*/
package org.apache.sling.api.resource.path;
-import org.junit.Test;
-
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
public class PathTest {
@Test public void testRootMatching() {
@@ -73,4 +73,11 @@ public class PathTest {
assertTrue(path.matches("glob:/apps/myproject/components/**/*.html"));
assertTrue(path.matches("glob:/apps/**/*.html"));
}
+
+ @Test public void testPathMatchingTrailingSlash() {
+ final Path path = new Path("/libs/");
+ assertTrue(path.matches("/libs"));
+ assertTrue(path.matches("/libs/foo"));
+ assertFalse(path.matches("/lib"));
+ }
}