Skip to content

Commit a2481e9

Browse files
committed
fixed path separator handling for windows compatibility
1 parent 31f1e97 commit a2481e9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

jjava-jupyter/src/test/java/org/dflib/jjava/jupyter/kernel/util/PathsHandlerTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,17 @@ public void testSpitAndResolveGlobs(@TempDir Path dir) throws IOException {
3030
Files.createFile(dir.resolve("b2.txt"));
3131
Files.createFile(dir.resolve("c1.txt"));
3232

33-
String basePath = dir + File.separator;
33+
// GlobResolver requires "/" as path separator (also on Windows)
34+
String basePath = dir.toString().replace(File.separator, "/") + "/";
3435

3536
assertEquals(List.of(), PathsHandler.splitAndResolveGlobs(""));
3637
assertEquals(List.of(), PathsHandler.splitAndResolveGlobs(basePath + "a"));
3738
assertEquals(List.of(), PathsHandler.splitAndResolveGlobs(basePath + "a" + File.pathSeparator + "b/c/d"));
3839

3940
assertEquals(List.of(basePath + "a1.txt", basePath + "a2.txt"),
40-
PathsHandler.splitAndResolveGlobs(basePath + "a*").stream().map(p -> p.toAbsolutePath().toString()).sorted().collect(Collectors.toList()));
41+
PathsHandler.splitAndResolveGlobs(basePath + "a*").stream().map(p -> p.toAbsolutePath().toString().replace(File.separator, "/")).sorted().collect(Collectors.toList()));
4142
assertEquals(
4243
List.of(basePath + "a1.txt", basePath + "a2.txt", basePath + "b1.txt", basePath + "b2.txt"),
43-
PathsHandler.splitAndResolveGlobs(basePath + "a*" + File.pathSeparator + basePath + "b*").stream().map(p -> p.toAbsolutePath().toString()).sorted().collect(Collectors.toList()));
44+
PathsHandler.splitAndResolveGlobs(basePath + "a*" + File.pathSeparator + basePath + "b*").stream().map(p -> p.toAbsolutePath().toString().replace(File.separator, "/")).sorted().collect(Collectors.toList()));
4445
}
4546
}

0 commit comments

Comments
 (0)