Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fsharp.Formatting MetadataFormat no longer crashes on C# dlls #212

Merged
merged 1 commit into from
Oct 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/FSharp.MetadataFormat/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module ValueReader =
static member Create(publicOnly, map, sourceFolderRepo, urlRangeHighlight, markDownComments) =
let usedNames = Dictionary<_, _>()
let nameGen (name:string) =
let nice = name.Replace(".", "-").Replace("`", "-").ToLower()
let nice = name.Replace(".", "-").Replace("`", "-").Replace("<", "").Replace(">", "").ToLower()
let found =
seq { yield nice
for i in Seq.initInfinite id do yield sprintf "%s-%d" nice i }
Expand Down
15 changes: 15 additions & 0 deletions tests/FSharp.MetadataFormat.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,18 @@ let ``MetadataFormat process XML comments in two sample F# assemblies``() =
files.["fslib-nested.html"] |> should contain "Somewhat nested module"
files.["fslib-nested-nestedtype.html"] |> should contain "Very nested member"
files.["fslib-nested-submodule.html"] |> should contain "Very nested field"

[<Test>]
let ``MetadataFormat handles c# dlls`` () =
let library = root @@ "files" @@ "CSharpFormat.dll"
let output = getOutputDir()
MetadataFormat.Generate
( library, output, layoutRoots, info, libDirs = [root @@ "../../lib"])
let files = Directory.GetFiles(output)

let optIndex = files |> Seq.tryFind (fun s -> s.EndsWith "index.html")
optIndex.IsSome |> shouldEqual true

#if INTERACTIVE
System.Diagnostics.Process.Start(output)
#endif
Loading