MCPcopy
hub / github.com/chrislusf/glow / TestMapSingleParameter

Function TestMapSingleParameter

flow/dataset_map_test.go:8–21  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestMapSingleParameter(t *testing.T) {
9 dataset := New().Slice(
10 []int{1, 2, 3},
11 ).Map(func(t int) (int, int) {
12 return t, t
13 }).Map(func(x, y int) int {
14 return x + y
15 })
16 got := collectOutput(dataset)
17
18 if want := []int{2, 4, 6}; !reflect.DeepEqual(got, want) {
19 t.Errorf("Got: %v want: %v", got, want)
20 }
21}
22
23func TestGroupByKeyMap(t *testing.T) {
24 dataset := New().Slice(

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
collectOutputFunction · 0.85
MapMethod · 0.80
SliceMethod · 0.80

Tested by

no test coverage detected