MCPcopy Index your code
hub / github.com/filebrowser/filebrowser / TestFileInfoRealPathUsesBasePathFsRealPath

Function TestFileInfoRealPathUsesBasePathFsRealPath

files/fs_test.go:109–121  ·  view source on GitHub ↗

TestFileInfoRealPathUsesBasePathFsRealPath mirrors TestFileInfoRealPathUsesScopedFsRealPath for the follow-external-symlinks case, where the user filesystem is a bare BasePathFs.

(t *testing.T)

Source from the content-addressed store, hash-verified

107// TestFileInfoRealPathUsesScopedFsRealPath for the follow-external-symlinks case,
108// where the user filesystem is a bare BasePathFs.
109func TestFileInfoRealPathUsesBasePathFsRealPath(t *testing.T) {
110 root := t.TempDir()
111 file := &FileInfo{
112 Fs: NewFs(afero.NewOsFs(), root, true),
113 Path: "/root/downloads",
114 }
115
116 got := file.RealPath()
117 want := filepath.Join(root, "root", "downloads")
118 if got != want {
119 t.Fatalf("got %q, want %q", got, want)
120 }
121}

Callers

nothing calls this directly

Calls 2

RealPathMethod · 0.95
NewFsFunction · 0.85

Tested by

no test coverage detected