| 274 | } |
| 275 | |
| 276 | func TestAny_Strings(t *testing.T) { |
| 277 | secrets := map[string]bool{"SECRET_A": true, "SECRET_B": false} |
| 278 | |
| 279 | // Mirrors the pattern used in engine_secrets.go |
| 280 | exists := Any([]string{"SECRET_A", "SECRET_C"}, func(alt string) bool { |
| 281 | return secrets[alt] |
| 282 | }) |
| 283 | assert.True(t, exists, "Any should return true when one alternative secret exists") |
| 284 | |
| 285 | notExists := Any([]string{"SECRET_C", "SECRET_D"}, func(alt string) bool { |
| 286 | return secrets[alt] |
| 287 | }) |
| 288 | assert.False(t, notExists, "Any should return false when no alternative secret exists") |
| 289 | } |
| 290 | |
| 291 | func TestAny_StopsEarly(t *testing.T) { |
| 292 | callCount := 0 |