func TestMaybeFlatmap(t *testing.T) { lst := lists.NewList([]lists.Maybe{ lists.CreateBooleanResult(true), lists.CreateBooleanResult(false), lists.CreateBooleanResult(true), }).FlatMap() assert.Equal(t, 2, lst.Count()) }
func TestFlatMap(t *testing.T) { col := []lists.List{ generateList().Take(1), generateList().Take(0), generateList().Take(10), } outerList := lists.NewList(col) fm := outerList.FlatMap() assert.Equal(t, 11, fm.Count()) }
func makeBaseList() lists.List { return lists.NewList([]int{0, 1, 2}) }
func TestEmptyList(t *testing.T) { el := lists.NewList(nil) assert.Equal(t, true, el.Done()) }