(t *testing.T)
| 289 | } |
| 290 | |
| 291 | func TestAny_StopsEarly(t *testing.T) { |
| 292 | callCount := 0 |
| 293 | slice := []int{1, 2, 3, 4, 5} |
| 294 | Any(slice, func(x int) bool { |
| 295 | callCount++ |
| 296 | return x == 2 // matches at index 1 |
| 297 | }) |
| 298 | assert.Equal(t, 2, callCount, "Any should stop evaluating after first match") |
| 299 | } |
| 300 | |
| 301 | func TestMergeUnique(t *testing.T) { |
| 302 | tests := []struct { |