File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/FSharp.Control.TaskSeq.Test Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -78,3 +78,19 @@ module Other =
78
78
let defaultValue = enumerator.Current // should return the default value for int
79
79
defaultValue |> should equal 0
80
80
}
81
+
82
+ [<Fact>]
83
+ let ``TaskSeq - singleton multiple MoveNext is fine`` () = task {
84
+ let enumerator = ( TaskSeq.singleton 42 ). GetAsyncEnumerator()
85
+ let! isNext = enumerator.MoveNextAsync()
86
+ isNext |> should be True
87
+ let! _ = enumerator.MoveNextAsync()
88
+ let! _ = enumerator.MoveNextAsync()
89
+ let! _ = enumerator.MoveNextAsync()
90
+ let! isNext = enumerator.MoveNextAsync()
91
+ isNext |> should be False
92
+
93
+ // should return the default value for int after moving past the end
94
+ let defaultValue = enumerator.Current
95
+ defaultValue |> should equal 0
96
+ }
You can’t perform that action at this time.
0 commit comments