assertTrue(matcher.isSatisfiedBy(path));
}
@Test public void testGreedy() {
matcher = new DefaultPatternMatcher(true, true, "a","**");
path = new RelativePath(true, "a", "b", "c");
assertTrue(matcher.isSatisfiedBy(path));
//leading greedy
matcher = new DefaultPatternMatcher(true, true, "**", "c");
path = new RelativePath(true, "a", "b", "c");
assertTrue(matcher.isSatisfiedBy(path));
path = new RelativePath(true, "a", "b", "d");
assertFalse(matcher.isSatisfiedBy(path));
// inner greedy
matcher = new DefaultPatternMatcher(true, true, "a", "**", "c");
path = new RelativePath(true, "a", "b", "c");
assertTrue(matcher.isSatisfiedBy(path));
path = new RelativePath(true, "a", "aa", "bb", "c");
assertTrue(matcher.isSatisfiedBy(path));
path = new RelativePath(false, "a", "aa", "bb", "d");
assertTrue(matcher.isSatisfiedBy(path));
path = new RelativePath(true, "a", "aa", "bb", "d");
assertFalse(matcher.isSatisfiedBy(path));
// fake trail
matcher = new DefaultPatternMatcher(true, true, "a", "**", "c", "d");
path = new RelativePath(true, "a", "b", "c", "e", "c", "d");
assertTrue(matcher.isSatisfiedBy(path));
// multiple greedies
matcher = new DefaultPatternMatcher(true, true, "a", "**", "c", "**", "e");
path = new RelativePath(true, "a", "b", "c", "d", "e");
assertTrue(matcher.isSatisfiedBy(path));
path = new RelativePath(true, "a", "b", "bb", "c", "d", "e");
assertTrue(matcher.isSatisfiedBy(path));
path = new RelativePath(true, "a", "q", "bb", "c", "d", "c", "d", "e");
assertTrue(matcher.isSatisfiedBy(path));
// Missing greedy
matcher = new DefaultPatternMatcher(true, true, "a", "**", "c");
path = new RelativePath(true, "a", "c");
assertTrue(matcher.isSatisfiedBy(path));
path = new RelativePath(true, "a", "d");
assertFalse(matcher.isSatisfiedBy(path));
}