Skip to content

Commit 568f754

Browse files
committed
Add a do-bang test with Task.Delay from the issue description
1 parent 1e643eb commit 568f754

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/FSharp.Control.TaskSeq.Test/TaskSeq.Do.Tests.fs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,15 @@ let ``CE taskSeq: use 'do!' with a non-generic task`` () =
4444
taskSeq { do! (task { do value <- value + 1 }) |> Task.ignore }
4545
|> verifyEmpty
4646
|> Task.map (fun _ -> value |> should equal 1)
47+
48+
[<Fact>]
49+
let ``CE taskSeq: use 'do!' with a task-delay`` () =
50+
let mutable value = 0
51+
52+
taskSeq {
53+
do value <- value + 1
54+
do! Task.Delay 50
55+
do value <- value + 1
56+
}
57+
|> verifyEmpty
58+
|> Task.map (fun _ -> value |> should equal 2)

0 commit comments

Comments
 (0)