1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-13 17:22:27 +08:00

feat: add FlattenDeep func

This commit is contained in:
dudaodong
2022-01-01 18:14:35 +08:00
parent b42aac53b3
commit 042a00296f
3 changed files with 53 additions and 7 deletions

View File

@@ -173,6 +173,17 @@ func TestFind(t *testing.T) {
}
}
func TestFlattenDeep(t *testing.T) {
input := [][][]string{{{"a", "b"}}, {{"c", "d"}}}
expected := []string{"a", "b", "c", "d"}
res := FlattenDeep(input)
if !reflect.DeepEqual(res, expected) {
internal.LogFailedTestInfo(t, "FlattenDeep", input, expected, res)
t.FailNow()
}
}
func TestMap(t *testing.T) {
s1 := []int{1, 2, 3, 4}
multiplyTwo := func(i, num int) int {