MCPcopy Index your code
hub / github.com/coder/coder / TempDirResolved

Function TempDirResolved

testutil/temp.go:66–73  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

64// returned. This matches the lenient behavior already used in
65// existing tests.
66func 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}

Callers 3

initTestRepoFunction · 0.92

Calls 2

HelperMethod · 0.65
TempDirMethod · 0.65

Tested by 3

initTestRepoFunction · 0.74