You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assert.AreEqual (true, t13.IsFaulted,"Task.zip(3) between a value, an exception and a cancellation -> exception wins.")
193
+
letac2= t13.Exception.InnerExceptions |> Seq.map (fun x -> int (Char.GetNumericValue x.Message.[35]))
194
+
CollectionAssert.AreEquivalent ([1;3], ac2,"Task.zip between 2 exceptions => both exceptions returned, even after combining with cancellation and values.")
195
+
196
+
[<Test>]
197
+
lettestTaskZipAsync()=
198
+
lett1= createTask true201
199
+
lett2= createTask true102
200
+
lett3= createTask true303
201
+
202
+
letc=new CancellationToken true
203
+
lett4= Task.FromCanceled<int> c
204
+
205
+
lett5= createTask false205
206
+
lett6= createTask false106
207
+
208
+
lett12= Task.WhenAll [t1; t2]
209
+
lett12t12= Task.WhenAll [t12; t12]
210
+
lett33= Task.WhenAll [t3; t3]
211
+
212
+
Task.WaitAny t12 |> ignore
213
+
Task.WaitAny t12t12 |> ignore
214
+
Task.WaitAny t33 |> ignore
215
+
216
+
lett12123= Task.zip3 t12t12 t33 t4
217
+
letac1=
218
+
try
219
+
t12123.Exception.InnerExceptions |> Seq.map (fun x -> int (Char.GetNumericValue x.Message.[35]))
220
+
with e ->
221
+
failwithf "Failure in testTaskZipAsync. Task status is %A . Exception is %A" t12123.Status e
222
+
223
+
CollectionAssert.AreEquivalent ([1;2;1;2;3], ac1,"Task.zip(3)Async should add only non already existing exceptions.")
Assert.AreEqual (true, t13.IsFaulted,"Task.zip(3)Async between a value, an exception and a cancellation -> exception wins.")
227
+
letac2= t13.Exception.InnerExceptions |> Seq.map (fun x -> int (Char.GetNumericValue x.Message.[35]))
228
+
CollectionAssert.AreEquivalent ([1;3], ac2,"Task.zipAsync between 2 exceptions => both exceptions returned, even after combining with cancellation and values.")
0 commit comments