Skip to content

Commit 97c0e3d

Browse files
github-actions[bot]Repo AssistCopilot
authored
Add tests for yield! list<'T> in asyncSeq computation expression (#240)
Co-authored-by: Repo Assist <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent c39802b commit 97c0e3d

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,26 @@ let ``asyncSeq yield! seq combines with other yields``() =
176176
let a = s |> AsyncSeq.toListSynchronously
177177
Assert.True(([1;2;3;4] = a))
178178

179+
[<Test>]
180+
let ``asyncSeq yield! list works``() =
181+
let items = [1; 2; 3]
182+
let s = asyncSeq {
183+
yield! items
184+
}
185+
let a = s |> AsyncSeq.toListSynchronously
186+
Assert.True(([1;2;3] = a))
187+
188+
[<Test>]
189+
let ``asyncSeq yield! list combines with other yields``() =
190+
let items = [2; 3]
191+
let s = asyncSeq {
192+
yield 1
193+
yield! items
194+
yield 4
195+
}
196+
let a = s |> AsyncSeq.toListSynchronously
197+
Assert.True(([1;2;3;4] = a))
198+
179199
[<Test>]
180200
let ``AsyncSeq.concatSeq works``() =
181201
let ls = [ [1;2] ; [3;4] ]

0 commit comments

Comments
 (0)