MCPcopy
hub / github.com/duke-git/lancet / TestReduce

Function TestReduce

iterator/operation_test.go:62–70  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

60}
61
62func TestReduce(t *testing.T) {
63 t.Parallel()
64
65 assert := internal.NewAssert(t, "TestReduce")
66
67 var iter Iterator[int] = FromSlice([]int{1, 2, 3, 4})
68 sum := Reduce(iter, 0, func(a, b int) int { return a + b })
69 assert.Equal(10, sum)
70}
71
72func TestTakeIterator(t *testing.T) {
73 t.Parallel()

Callers

nothing calls this directly

Calls 4

EqualMethod · 0.95
NewAssertFunction · 0.92
FromSliceFunction · 0.70
ReduceFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…