Skip to content

Commit

Permalink
Add tests for fixed cases
Browse files Browse the repository at this point in the history
  • Loading branch information
BoundedChenn31 committed Aug 30, 2022
1 parent 018739c commit ced0f05
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/FSharp.ApiDocs.Tests/ApiDocsTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,17 @@ let ``ApiDocs works on two sample F# assemblies`` (format: OutputFormat) =
files.[(sprintf "fslib-union.%s" format.Extension)]
|> shouldContainText "<span>Naming(<span>rate,&#32;string</span>)</span>"

// Check that operators are encoded
files[(sprintf "fslib-operatorswithfsi.%s" format.Extension)]
|> shouldContainText "&lt;&amp;&gt;"

// Check that parameters are indexed
files[(sprintf "fslib-operatorswithfsi.%s" format.Extension)]
|> shouldContainText "arg0"

files[(sprintf "fslib-operatorswithfsi.%s" format.Extension)]
|> shouldContainText "arg1"

(* This may be addressed in a separate issue or removed if not an issue.
// Check that implict cast operator is generated correctly
files.[(sprintf "fslib-space-missing-implicit-cast.%s" format.Extension)] |> shouldContainText "<code><span>op_Implicit&#32;<span>source</span></span></code>"
Expand Down
2 changes: 2 additions & 0 deletions tests/FSharp.ApiDocs.Tests/files/FsLib1/FsLib1.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="Library1.fs" />
<Compile Include="OperatorsWithFsi.fsi" />
<Compile Include="OperatorsWithFsi.fs" />
<None Include="paket.references" />
</ItemGroup>
<Import Project="..\..\..\..\.paket\Paket.Restore.targets" />
Expand Down
4 changes: 4 additions & 0 deletions tests/FSharp.ApiDocs.Tests/files/FsLib1/OperatorsWithFsi.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module FsLib.OperatorsWithFsi

let (<&>) (x: 'T) (y: 'T) = x < y

5 changes: 5 additions & 0 deletions tests/FSharp.ApiDocs.Tests/files/FsLib1/OperatorsWithFsi.fsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module FsLib.OperatorsWithFsi

/// <summary>The operator</summary>
val ( <&> ) : 'T -> 'T -> bool when 'T : comparison

0 comments on commit ced0f05

Please sign in to comment.