fix: restore ScopedFs RealPath (#5986)

This commit is contained in:
yfzhou authored and GitHub committed 2026-06-13 07:17:48 +02:00
1 parent dfe6e5b333
commit 403d2bbd33
2 files changed
+21

No files matched your search

+14
View File
@@ -212,3 +212,17 @@ func TestReadListingSkipsInaccessibleChildren(t *testing.T) {
t.Fatalf("expected one listed directory, got %d", got)
}
}
func TestFileInfoRealPathUsesScopedFsRealPath(t *testing.T) {
root := t.TempDir()
file := &FileInfo{
Fs: NewScopedFs(afero.NewOsFs(), root),
Path: "/root/downloads",
}
got := file.RealPath()
want := filepath.Join(root, "root", "downloads")
if got != want {
t.Fatalf("got %q, want %q", got, want)
}
}