Browse Source

commit a test illustrated by the bug report 59114, that is that the "**" pattern matches the empty path, but the "*" pattern does not.

master
Antoine Levy-Lambert 9 years ago
parent
commit
8bb69bfdd8
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      src/tests/junit/org/apache/tools/ant/types/selectors/TokenizedPatternTest.java

+ 13
- 0
src/tests/junit/org/apache/tools/ant/types/selectors/TokenizedPatternTest.java View File

@@ -22,6 +22,7 @@ import java.io.File;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
public class TokenizedPatternTest {
@@ -61,4 +62,16 @@ public class TokenizedPatternTest {
.withoutLastToken().matchPath(p, true));
}
@Test
/**
* this test illustrates the behavior described in bugzilla 59114
* meaning that the pattern "**" matches the empty path
* but the pattern "*" does not
*/
public void testEmptyFolderWithStarStar() {
TokenizedPath p = TokenizedPath.EMPTY_PATH;
assertTrue(new TokenizedPattern(SelectorUtils.DEEP_TREE_MATCH).matchPath(p, true));
assertFalse(new TokenizedPattern("*").matchPath(p, true));
}
}

Loading…
Cancel
Save