Skip to content

Commit

Permalink
Update fsharp.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 14, 2021
1 parent e93381e commit c040098
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion docs/fsharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ let MyTest () =
<sup><a href='/src/FSharpTests/Tests.fs#L14-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-fstest' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Tasks can also be used directly via a `task` computation expression builder, such as the ones included in [Ply](https://github.com/crowded/ply), [TaskBuilder.fs](https://github.com/rspeele/TaskBuilder.fs), or (starting with F# 6.0) FSharp.Core:

<!-- snippet: FsTestTask -->
<a id='snippet-fstesttask'></a>
```fs
[<Fact>]
let MyTaskTest () =
task {
do! Verifier.Verify(15)
}
```
<sup><a href='/src/FSharpTests/Tests.fs#L23-L29' title='Snippet source file'>snippet source</a> | <a href='#snippet-fstesttask' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

## Full tests

Expand All @@ -63,6 +76,12 @@ let MyTest () =
.ToTask() |> Async.AwaitTask
}
[<Fact>]
let MyTaskTest () =
task {
do! Verifier.Verify(15)
}
[<Fact>]
let WithFluentSetting () =
async {
Expand All @@ -72,5 +91,5 @@ let WithFluentSetting () =
}
do ()
```
<sup><a href='/src/FSharpTests/Tests.fs#L1-L26' title='Snippet source file'>snippet source</a> | <a href='#snippet-FSharpTests/Tests.fs' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/FSharpTests/Tests.fs#L1-L32' title='Snippet source file'>snippet source</a> | <a href='#snippet-FSharpTests/Tests.fs' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

0 comments on commit c040098

Please sign in to comment.