TempDirResolved returns t.TempDir() with symlinks resolved via filepath.EvalSymlinks. Tests that compare paths against values processed by EvalSymlinks (directly or indirectly) should use this helper so the comparison works on macOS, where the default temp dir lives under /var which is a symlink to
(t *testing.T)
| 64 | // returned. This matches the lenient behavior already used in |
| 65 | // existing tests. |
| 66 | func TempDirResolved(t *testing.T) string { |
| 67 | t.Helper() |
| 68 | dir := t.TempDir() |
| 69 | if resolved, err := filepath.EvalSymlinks(dir); err == nil { |
| 70 | return resolved |
| 71 | } |
| 72 | return dir |
| 73 | } |