|
|
@ -82,6 +82,16 @@ public class PathSuffixFilterTest extends RepositoryTestCase { |
|
|
|
assertEquals(expected, paths); |
|
|
|
assertEquals(expected, paths); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void testEdgeCases() throws IOException { |
|
|
|
|
|
|
|
ObjectId treeId = createTree("abc", "abcd", "bcd", "c"); |
|
|
|
|
|
|
|
assertEquals(new ArrayList<String>(), getMatchingPaths("xbcd", treeId)); |
|
|
|
|
|
|
|
assertEquals(new ArrayList<String>(), getMatchingPaths("abcx", treeId)); |
|
|
|
|
|
|
|
assertEquals(Arrays.asList("abcd"), getMatchingPaths("abcd", treeId)); |
|
|
|
|
|
|
|
assertEquals(Arrays.asList("abcd", "bcd"), getMatchingPaths("bcd", treeId)); |
|
|
|
|
|
|
|
assertEquals(Arrays.asList("abc", "c"), getMatchingPaths("c", treeId)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ObjectId createTree(String... paths) throws IOException { |
|
|
|
private ObjectId createTree(String... paths) throws IOException { |
|
|
|
final ObjectInserter odi = db.newObjectInserter(); |
|
|
|
final ObjectInserter odi = db.newObjectInserter(); |
|
|
|
final DirCache dc = db.readDirCache(); |
|
|
|
final DirCache dc = db.readDirCache(); |
|
|
|