1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-10 15:52:27 +08:00

feat: add Concat for stream

This commit is contained in:
dudaodong
2023-02-07 10:47:28 +08:00
parent 422022c74d
commit 6bba44dc50
2 changed files with 24 additions and 3 deletions

View File

@@ -292,3 +292,14 @@ func TestStream_Range(t *testing.T) {
s6 := s.Range(0, 4)
assert.Equal([]int{1, 2, 3}, s6.ToSlice())
}
func TestStream_Concat(t *testing.T) {
assert := internal.NewAssert(t, "TestStream_Concat")
s1 := FromSlice([]int{1, 2, 3})
s2 := FromSlice([]int{4, 5, 6})
s := Concat(s1, s2)
assert.Equal([]int{1, 2, 3, 4, 5, 6}, s.ToSlice())
}