Skip to content

Commit

Permalink
Adding regression test for #516. (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf authored May 15, 2020
1 parent 057d882 commit 622e2b0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/Fantomas.Tests/CommentTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,38 @@ printfn "hello world"
(* This is a comment. *)
"""

[<Test>]
let ``preserve block comment after record, 516`` () =
formatSourceString false """module TriviaModule =

let env = "DEBUG"

type Config = {
Name: string
Level: int
}

let meh = { // this comment right
Name = "FOO"; Level = 78 }

(* ending with block comment *)
""" config
|> prepend newline
|> should equal """
module TriviaModule =

let env = "DEBUG"

type Config = { Name: string; Level: int }

let meh =
{ // this comment right
Name = "FOO"
Level = 78 }

(* ending with block comment *)
"""

[<Test>]
let ``should keep comments inside unit``() =
formatSourceString false """
Expand Down

0 comments on commit 622e2b0

Please sign in to comment.