Repository: ant Updated Branches: refs/heads/master 588ce1fbe -> 8bb69bfdd
commit a test illustrated by the bug report 59114, that is that the "**" pattern matches the empty path, but the "*" pattern does not. Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/8bb69bfd Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/8bb69bfd Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/8bb69bfd Branch: refs/heads/master Commit: 8bb69bfdd8201ffbd531097d95f29c8a3e88a7a6 Parents: 588ce1f Author: Antoine Levy-Lambert <[email protected]> Authored: Sun Mar 6 22:37:05 2016 -0500 Committer: Antoine Levy-Lambert <[email protected]> Committed: Sun Mar 6 22:37:05 2016 -0500 ---------------------------------------------------------------------- .../ant/types/selectors/TokenizedPatternTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/8bb69bfd/src/tests/junit/org/apache/tools/ant/types/selectors/TokenizedPatternTest.java ---------------------------------------------------------------------- diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/TokenizedPatternTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/TokenizedPatternTest.java index fb068a3..55f7b03 100644 --- a/src/tests/junit/org/apache/tools/ant/types/selectors/TokenizedPatternTest.java +++ b/src/tests/junit/org/apache/tools/ant/types/selectors/TokenizedPatternTest.java @@ -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)); + } + }
