MCPcopy Create free account
hub / github.com/github/gh-aw / TestImportCacheGetDoesNotValidateComponents

Function TestImportCacheGetDoesNotValidateComponents

pkg/parser/import_cache_test.go:394–403  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

392}
393
394func TestImportCacheGetDoesNotValidateComponents(t *testing.T) {
395 // Document that Get does not validate components (unlike Set).
396 // If validation is added in the future, this test should be updated.
397 tempDir := t.TempDir()
398 cache := NewImportCache(tempDir)
399
400 // Should return not-found (not panic or error), even with suspicious inputs.
401 _, found := cache.Get("../etc", "repo", "test.md", "sha")
402 assert.False(t, found, "Get with path traversal input should return not-found, not panic")
403}

Callers

nothing calls this directly

Calls 2

GetMethod · 0.95
NewImportCacheFunction · 0.85

Tested by

no test coverage detected