MCPcopy Create free account
hub / github.com/Soft/iter / TestAny

Function TestAny

iterator_test.go:209–237  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

207}
208
209func TestAny(t *testing.T) {
210 equals(t,
211 Any(
212 Empty[int](),
213 func(n int) bool {
214 return n > 0
215 },
216 ),
217 false,
218 )
219 equals(t,
220 Any(
221 Slice([]int{5, 6, 7, 8, 9}),
222 func(n int) bool {
223 return n > 7
224 },
225 ),
226 true,
227 )
228 equals(t,
229 Any(
230 Slice([]int{1, 2, 3, 4, 5}),
231 func(n int) bool {
232 return n > 5
233 },
234 ),
235 false,
236 )
237}
238
239func TestNth(t *testing.T) {
240 equals(t, Nth(Slice([]int{1, 2, 3, 4, 5}), 0).Unwrap(), 1)

Callers

nothing calls this directly

Calls 3

equalsFunction · 0.85
AnyFunction · 0.85
SliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…