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

Function TestAny_Strings

pkg/sliceutil/sliceutil_test.go:276–289  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

274}
275
276func 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
291func TestAny_StopsEarly(t *testing.T) {
292 callCount := 0

Callers

nothing calls this directly

Calls 1

AnyFunction · 0.85

Tested by

no test coverage detected