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 |> Async.AsTaskAndWait).IsFaulted,"Async.zip(3) between a value, an exception and a cancellation -> exception wins.")
79
+
letac2=(t13 |> Async.AsTaskAndWait).Exception.InnerExceptions |> Seq.map (fun x -> int (Char.GetNumericValue x.Message.[35]))
80
+
CollectionAssert.AreEquivalent ([1;3], ac2,"Async.zip between 2 exceptions => both exceptions returned, even after combining with cancellation and values.")
81
+
82
+
[<Test>]
83
+
lettestAsyncZipAsync()=
84
+
lett1= createAsync true201
85
+
lett2= createAsync true102
86
+
lett3= createAsync true303
87
+
88
+
letc=new CancellationToken true
89
+
lett4= Task.FromCanceled<int> c |> Async.Await
90
+
91
+
lett5= createAsync false205
92
+
lett6= createAsync false106
93
+
94
+
lett12= Async.WhenAll [t1; t2]
95
+
lett12t12= Async.WhenAll [t12; t12]
96
+
lett33= Async.WhenAll [t3; t3]
97
+
98
+
lett12123= Async.zip3 t12t12 t33 t4
99
+
letac1=
100
+
try
101
+
(t12123 |> Async.AsTaskAndWait).Exception.InnerExceptions |> Seq.map (fun x -> int (Char.GetNumericValue x.Message.[35]))
102
+
with e ->
103
+
failwithf "Failure in testAsyncZipAsync. Async status is %A . Exception is %A"(t12123 |> Async.AsTaskAndWait).Status e
104
+
105
+
CollectionAssert.AreEquivalent ([1;2;1;2;3], ac1,"Async.zip(3)Async should add only non already existing exceptions.")
Assert.AreEqual (true,(t13 |> Async.AsTaskAndWait).IsFaulted,"Async.zip(3)Async between a value, an exception and a cancellation -> exception wins.")
109
+
letac2=(t13 |> Async.AsTaskAndWait).Exception.InnerExceptions |> Seq.map (fun x -> int (Char.GetNumericValue x.Message.[35]))
110
+
CollectionAssert.AreEquivalent ([1;3], ac2,"Async.zipAsync between 2 exceptions => both exceptions returned, even after combining with cancellation and values.")
0 commit comments