Skip to content

Commit

Permalink
it was xunit after all
Browse files Browse the repository at this point in the history
  • Loading branch information
majocha committed Sep 21, 2024
1 parent c0ce09c commit 3da12b9
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,17 @@ module AsyncType =
let onExeption = cont Exception
let onCancellation = cont Cancellation

let expect expected cancellationToken computation =
Async.StartWithContinuations(computation, onSuccess expected, onExeption expected, onCancellation expected, ?cancellationToken = cancellationToken)
let expect expected computation =
Async.StartWithContinuations(computation, onSuccess expected, onExeption expected, onCancellation expected)

let cancelledToken =
let cts = new CancellationTokenSource()
cts.Cancel()
Some cts.Token

async { return () } |> expect Cancellation cancelledToken
async {
Async.CancelDefaultToken()
return ()
} |> expect Cancellation

async { failwith "computation failed" } |> expect Exception None
async { failwith "computation failed" } |> expect Exception

async { return () } |> expect Success None
async { return () } |> expect Success



Expand Down

0 comments on commit 3da12b9

Please sign in to comment.