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

Function TestResolvePath_HomeUnset

agent/agentcontextconfig/resolve_test.go:79–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestResolvePath_HomeUnset(t *testing.T) {
80 // Cannot be parallel — modifies HOME env var.
81 t.Setenv("HOME", "")
82 // Also clear USERPROFILE for Windows compatibility.
83 t.Setenv("USERPROFILE", "")
84
85 require.Equal(t, "", agentcontextconfig.ResolvePath("~", platformAbsPath("base")))
86 require.Equal(t, "", agentcontextconfig.ResolvePath("~/docs", platformAbsPath("base")))
87}
88
89func TestResolvePaths(t *testing.T) { //nolint:tparallel // subtests using t.Setenv cannot be parallel
90 t.Run("EmptyString", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

ResolvePathFunction · 0.92
SetenvMethod · 0.80
platformAbsPathFunction · 0.70
EqualMethod · 0.45

Tested by

no test coverage detected