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

Function TestActionCacheEmptySaveDoesNotCreateFile

pkg/workflow/action_cache_test.go:207–225  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

205}
206
207func TestActionCacheEmptySaveDoesNotCreateFile(t *testing.T) {
208 // Create temporary directory for testing
209 tmpDir := testutil.TempDir(t, "test-*")
210
211 // Create empty cache
212 cache := NewActionCache(tmpDir)
213
214 // Save empty cache
215 err := cache.Save()
216 if err != nil {
217 t.Fatalf("Failed to save empty cache: %v", err)
218 }
219
220 // Verify file does NOT exist
221 cachePath := filepath.Join(tmpDir, ".github", "aw", CacheFileName)
222 if _, err := os.Stat(cachePath); !os.IsNotExist(err) {
223 t.Error("Empty cache should not create a file")
224 }
225}
226
227func TestActionCacheEmptySaveDeletesExistingFile(t *testing.T) {
228 // Create temporary directory for testing

Callers

nothing calls this directly

Calls 4

SaveMethod · 0.95
TempDirFunction · 0.92
NewActionCacheFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected