Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed May 19, 2024
1 parent a3495d2 commit 139d7da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ public static List<Path> walkPathWithPattern(Path basePath, String pattern,
} else if (Files.isDirectory(basePath)) {
try (var walk = Files.walk(basePath, FileVisitOption.FOLLOW_LINKS)) {
return walk
.filter(path -> matcher.matches(path.getFileName()) || matcher.matches(basePath.relativize(path)))
.filter(path -> {
System.err.println(" " + basePath + " " + basePath.relativize(path) + " " + matcher.matches(basePath.relativize(path));
return matcher.matches(path.getFileName()) || matcher.matches(basePath.relativize(path));
})
.flatMap(path -> {
if (FileUtils.hasExtension(path, "zip")) {
return walkZipFile.apply(path).stream();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ void testWalkPathWithPattern() throws IOException {
Files.writeString(path, "test");
assertEquals(List.of(path), Glob.of(tmpDir).resolve("a", "*", "c.txt").find());
System.err.println(Glob.of(tmpDir).resolve("*", "*", "c.txt"));
System.err.println(Glob.of(tmpDir).resolve("*", "*", "c.txt").find());
System.err.println(Glob.of(tmpDir).resolve("**", "c.txt").find());
System.err.println(Glob.of(tmpDir).resolve("*", "b", "c.txt").find());
System.err.println(Glob.of(tmpDir).resolve("*", "*", "c.txt").find()); // nope
System.err.println(Glob.of(tmpDir).resolve("**", "c.txt").find()); // ok
System.err.println(Glob.of(tmpDir).resolve("*", "b", "c.txt").find()); // nada
assertEquals(List.of(path), Glob.of(tmpDir).resolve("*", "*", "c.txt").find());
assertEquals(List.of(path), Glob.of(tmpDir).resolve("a", "b", "c.txt").find());
}
Expand Down

0 comments on commit 139d7da

Please sign in to comment.