diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 7f8e630..c0bb677 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -8,11 +8,15 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ ubuntu-latest ] java: [ 11, 17, 21, 25 ] + include: + - os: windows-latest + java: 25 steps: - name: Checkout @@ -26,4 +30,11 @@ jobs: cache: 'maven' - name: Build and test - run: mvn clean verify -U + shell: bash + run: | + if [ "${{ runner.os }}" == "Windows" ]; then + # Testcontainers doesn't support Windows containers + mvn clean test -U + else + mvn clean verify -U + fi diff --git a/jjava-jupyter/src/test/java/org/dflib/jjava/jupyter/kernel/util/PathsHandlerTest.java b/jjava-jupyter/src/test/java/org/dflib/jjava/jupyter/kernel/util/PathsHandlerTest.java index 8737d2d..ceb6c80 100644 --- a/jjava-jupyter/src/test/java/org/dflib/jjava/jupyter/kernel/util/PathsHandlerTest.java +++ b/jjava-jupyter/src/test/java/org/dflib/jjava/jupyter/kernel/util/PathsHandlerTest.java @@ -9,6 +9,7 @@ import java.nio.file.Path; import java.util.List; import java.util.stream.Collectors; +import java.util.stream.Stream; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -30,16 +31,29 @@ public void testSpitAndResolveGlobs(@TempDir Path dir) throws IOException { Files.createFile(dir.resolve("b2.txt")); Files.createFile(dir.resolve("c1.txt")); - String basePath = dir + File.separator; + String baseGlob = dir + "/"; // glob resolver only accepts "/" as splitter assertEquals(List.of(), PathsHandler.splitAndResolveGlobs("")); - assertEquals(List.of(), PathsHandler.splitAndResolveGlobs(basePath + "a")); - assertEquals(List.of(), PathsHandler.splitAndResolveGlobs(basePath + "a" + File.pathSeparator + "b/c/d")); + assertEquals(List.of(), PathsHandler.splitAndResolveGlobs(baseGlob + "a")); + assertEquals(List.of(), PathsHandler.splitAndResolveGlobs(baseGlob + "a" + File.pathSeparator + "b/c/d")); - assertEquals(List.of(basePath + "a1.txt", basePath + "a2.txt"), - PathsHandler.splitAndResolveGlobs(basePath + "a*").stream().map(p -> p.toAbsolutePath().toString()).sorted().collect(Collectors.toList())); assertEquals( - List.of(basePath + "a1.txt", basePath + "a2.txt", basePath + "b1.txt", basePath + "b2.txt"), - PathsHandler.splitAndResolveGlobs(basePath + "a*" + File.pathSeparator + basePath + "b*").stream().map(p -> p.toAbsolutePath().toString()).sorted().collect(Collectors.toList())); + List.of(joinPath(dir, "a1.txt"), joinPath(dir, "a2.txt")), + PathsHandler.splitAndResolveGlobs(baseGlob + "a*").stream() + .map(p -> p.toAbsolutePath().toString()) + .sorted() + .collect(Collectors.toList()) + ); + assertEquals( + List.of(joinPath(dir, "a1.txt"), joinPath(dir, "a2.txt"), joinPath(dir, "b1.txt"), joinPath(dir, "b2.txt")), + PathsHandler.splitAndResolveGlobs(baseGlob + "a*" + File.pathSeparator + baseGlob + "b*").stream() + .map(p -> p.toAbsolutePath().toString()) + .sorted() + .collect(Collectors.toList()) + ); + } + + private static String joinPath(Object... elements) { + return Stream.of(elements).map(String::valueOf).collect(Collectors.joining(File.separator)); } }