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

Function TestFold

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

Source from the content-addressed store, hash-verified

118}
119
120func TestFold(t *testing.T) {
121 it := Slice([]int{1, 2, 3, 4, 5})
122 ret := Fold(it, 0, func(acc, i int) int {
123 return acc + i
124 })
125 equals(t, ret, 15)
126}
127
128func TestFuse(t *testing.T) {
129 state := true

Callers

nothing calls this directly

Calls 3

SliceFunction · 0.85
FoldFunction · 0.85
equalsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…