Skip to content

Commit

Permalink
Adds a test for the new streamPath method
Browse files Browse the repository at this point in the history
Fixes: SIRI-1028
  • Loading branch information
scireum-mbo committed Dec 10, 2024
1 parent 2bd2043 commit 4e138f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/kotlin/sirius/kernel/commons/FilesTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,13 @@ internal class FilesTest {
assertEquals(false, Files.isConsideredMetadata("thumbs.db"));
assertEquals(false, Files.isConsideredMetadata(null));
}

@Test
fun `streamPath works as expected`() {
assert(Files.streamPath("test1").toList().equals(listOf("test1")));
assertEquals(listOf("test2", "test1"), Files.streamPath("/test1/test2").toList());
assertEquals(listOf("test3", ".test2", "test1"), Files.streamPath("/test1/.test2/test3").toList());
assertEquals(listOf("test4.png", "test3", "test2", "test1"), Files.streamPath("/test1/test2/test3/test4.png").toList());
assertEquals(listOf(null, "test2", "test1"), Files.streamPath("/test1/test2/").toList());
}
}

0 comments on commit 4e138f5

Please sign in to comment.