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

Function TestTakeWhile

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

Source from the content-addressed store, hash-verified

97}
98
99func TestTakeWhile(t *testing.T) {
100 slice := ToSlice(
101 TakeWhile(
102 Slice([]int{1, 2, 3, 4, 5}),
103 func(i int) bool {
104 return i < 4
105 },
106 ),
107 )
108 equals(t, slice, []int{1, 2, 3})
109}
110
111func TestForEach(t *testing.T) {
112 it := Take(Repeat(1), 5)

Callers

nothing calls this directly

Calls 4

ToSliceFunction · 0.85
TakeWhileFunction · 0.85
SliceFunction · 0.85
equalsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…