MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / withTempCacheDir

Function withTempCacheDir

internal/desktop/tool_cache_test.go:13–20  ·  view source on GitHub ↗

withTempCacheDir points the detection cache at an isolated temp directory for the test and restores the original value on cleanup.

(t *testing.T)

Source from the content-addressed store, hash-verified

11// withTempCacheDir points the detection cache at an isolated temp directory
12// for the test and restores the original value on cleanup.
13func withTempCacheDir(t *testing.T) string {
14 t.Helper()
15 dir := t.TempDir()
16 previous := os.Getenv("CAM_CACHE_DIR")
17 os.Setenv("CAM_CACHE_DIR", dir)
18 t.Cleanup(func() { os.Setenv("CAM_CACHE_DIR", previous) })
19 return dir
20}
21
22func TestDetectionCacheGetMissing(t *testing.T) {
23 cache := newDetectionCache()

Calls

no outgoing calls

Tested by

no test coverage detected