@@ -38,7 +38,7 @@ module TaskModuleFunctionsTests =
3838 let ``Task.ignore discards result`` () =
3939 let t = Task.result 42 |> Task.ignore< int>
4040 t.Result
41- Assert.True( t.IsCompletedSuccessfully )
41+ Assert.True( t.Status = TaskStatus.RanToCompletion ) // IsCompletedSuccessfully would work but netstandard2.0
4242
4343 [<Fact>]
4444 let ``Task.catchWith recovers from exception ( sync ) `` () =
@@ -114,8 +114,7 @@ module TaskModuleFunctionsTests =
114114 Assert.False( t.IsCompleted)
115115 tcs.SetException( Exception " boom" )
116116 task {
117- let! result = t
118- match result with
117+ match ! t with
119118 | Error ex -> Assert.Equal( " boom" , ex.Message)
120119 | Ok _ -> failwith " expected Error"
121120 }
@@ -166,7 +165,7 @@ module TaskModuleFunctionsTests =
166165 let ``Task.empty returns completed unit task`` () =
167166 let t = Task.empty
168167 t.Result
169- Assert.True( t.IsCompletedSuccessfully )
168+ Assert.True( t.Status = TaskStatus.RanToCompletion ) // IsCompletedSuccessfully would work but netstandard2.0
170169
171170#if NETSTANDARD2_ 1
172171 [<Fact>]
@@ -293,8 +292,7 @@ module ValueTaskModuleFunctionsTests =
293292 Assert.False( vt.IsCompletedSuccessfully)
294293 tcs.SetException( Exception " boom" )
295294 task {
296- let! result = vt
297- match result with
295+ match ! vt with
298296 | Error ex -> Assert.Equal( " boom" , ex.Message)
299297 | Ok _ -> failwith " expected Error"
300298 }
@@ -317,7 +315,7 @@ module ValueTaskModuleFunctionsTests =
317315 Assert.False( vt.IsCompletedSuccessfully)
318316 tcs.SetCanceled()
319317 task {
320- match ! with
318+ match ! vt with
321319 | Error (: ? TaskCanceledException ) -> ()
322320 | r -> failwithf " expected Error(TaskCanceledException) but got %A " r
323321 }
0 commit comments