(t *testing.T)
| 52 | } |
| 53 | |
| 54 | func TestActionResolverCache(t *testing.T) { |
| 55 | // Create a cache and resolver |
| 56 | tmpDir := testutil.TempDir(t, "test-*") |
| 57 | cache := NewActionCache(tmpDir) |
| 58 | resolver := NewActionResolver(cache) |
| 59 | |
| 60 | // Manually add an entry to the cache |
| 61 | cache.Set("actions/checkout", "v5", "test-sha-123") |
| 62 | |
| 63 | // Resolve should return cached value without making API call |
| 64 | sha, err := resolver.ResolveSHA(context.Background(), "actions/checkout", "v5") |
| 65 | if err != nil { |
| 66 | t.Errorf("Expected no error for cached entry, got: %v", err) |
| 67 | } |
| 68 | if sha != "test-sha-123" { |
| 69 | t.Errorf("Expected SHA 'test-sha-123', got '%s'", sha) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | func TestActionResolverFailedResolutionCache(t *testing.T) { |
| 74 | // Create a cache and resolver |
nothing calls this directly
no test coverage detected