TestFileInfoRealPathUsesBasePathFsRealPath mirrors TestFileInfoRealPathUsesScopedFsRealPath for the follow-external-symlinks case, where the user filesystem is a bare BasePathFs.
(t *testing.T)
| 107 | // TestFileInfoRealPathUsesScopedFsRealPath for the follow-external-symlinks case, |
| 108 | // where the user filesystem is a bare BasePathFs. |
| 109 | func 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 | } |