Skip to content

Commit 12611ed

Browse files
committed
more vfs tests
1 parent a32e20d commit 12611ed

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

graalpython/com.oracle.graal.python.test/src/org/graalvm/python/embedding/utils/test/VirtualFileSystemTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,21 +629,25 @@ public void noExtractFilter() throws Exception {
629629
extractFilter(null).//
630630
resourceLoadingClass(VirtualFileSystemTest.class).build()) {
631631
FileSystem fs = getVFSImpl(vfs);
632-
checkNotExtracted(fs, VFS_ROOT_PATH);
632+
assertEquals(23, checkNotExtracted(fs, VFS_ROOT_PATH));
633633
}
634634
}
635635

636-
private void checkNotExtracted(FileSystem fs, Path dir) throws IOException {
636+
private int checkNotExtracted(FileSystem fs, Path dir) throws IOException {
637637
DirectoryStream<Path> ds = fs.newDirectoryStream(dir, (p) -> true);
638638
Iterator<Path> it = ds.iterator();
639+
int c = 0;
639640
while (it.hasNext()) {
641+
c++;
640642
Path p = it.next();
641643
assertTrue(p.toString().startsWith(VFS_ROOT));
644+
assertTrue(fs.toRealPath(p).startsWith(VFS_ROOT));
642645
fs.readAttributes(p, "isDirectory");
643646
if (Boolean.TRUE.equals((fs.readAttributes(p, "isDirectory").get("isDirectory")))) {
644-
checkNotExtracted(fs, p);
647+
c += checkNotExtracted(fs, p);
645648
}
646649
}
650+
return c;
647651
}
648652

649653
private interface ExceptionCall {

0 commit comments

Comments
 (0)