Skip to content

Commit 895b112

Browse files
committed
various size test for bufferByCountAndTime
1 parent 51595cd commit 895b112

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/FSharp.Control.AsyncSeq.Tests/AsyncSeqTests.fs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,16 @@ let ``AsyncSeq.bufferByTimeAndCount``() =
219219
let actual = AsyncSeq.bufferByCountAndTime 2 50 s |> AsyncSeq.toList
220220
Assert.True((actual = [ [|1;2|] ; [|3|] ; [|4;5|] ]))
221221

222+
[<Test>]
223+
let ``AsyncSeq.bufferByCountAndTime various sizes``() =
224+
for sz in 0 .. 10 do
225+
let s = asyncSeq {
226+
for i in 1 .. sz do
227+
yield i
228+
}
229+
let s' = s |> AsyncSeq.bufferByCountAndTime 1 1 |> AsyncSeq.toList
230+
Assert.True(([for i in 1 .. sz -> [|i|]] = s'))
231+
222232
[<Test>]
223233
let ``AsyncSeq.bufferByTimeAndCount empty``() =
224234
let s = AsyncSeq.empty<int>

0 commit comments

Comments
 (0)