(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestImportCacheMissingFile(t *testing.T) { |
| 98 | tempDir := t.TempDir() |
| 99 | |
| 100 | cache := NewImportCache(tempDir) |
| 101 | |
| 102 | // Add entry to cache |
| 103 | testContent := []byte("test") |
| 104 | cachedPath, err := cache.Set("owner", "repo", "test.md", "sha1", testContent) |
| 105 | require.NoError(t, err, "Set should succeed for valid inputs") |
| 106 | |
| 107 | // Delete the cached file |
| 108 | err = os.Remove(cachedPath) |
| 109 | require.NoError(t, err, "removing cached file should succeed") |
| 110 | |
| 111 | // Try to get the entry - should return not found since file is missing |
| 112 | _, found := cache.Get("owner", "repo", "test.md", "sha1") |
| 113 | assert.False(t, found, "Get should return cache miss when backing file has been deleted") |
| 114 | } |
| 115 | |
| 116 | func TestImportCacheEmptyCache(t *testing.T) { |
| 117 | tempDir := t.TempDir() |
nothing calls this directly
no test coverage detected