Skip to content
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
28 changes: 28 additions & 0 deletions src/Fantomas.Tests/AppTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -751,3 +751,31 @@ x |> f<y> // some comment
"""
x |> f<y> // some comment
"""

[<Test>]
let ``single named arguments should have space surrounding the '=', 1877`` () =
formatSourceString
false
"""
let makeStreamReader x = new System.IO.StreamReader(path=x)"""
config
|> prepend newline
|> should
equal
"""
let makeStreamReader x = new System.IO.StreamReader(path = x)
"""

[<Test>]
let ``multiple named arguments should have space surrounding the '=', 1877`` () =
formatSourceString
false
"""
let makeStreamReader x y = new StreamReader(arg1=x, arg2=y)"""
config
|> prepend newline
|> should
equal
"""
let makeStreamReader x y = new StreamReader(arg1 = x, arg2 = y)
"""
20 changes: 20 additions & 0 deletions src/Fantomas.Tests/PatternMatchingTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2047,3 +2047,23 @@ match!
| None -> false
| Some balance -> someRetrievedBalance = balance
"""

[<Test>]
let ``single line named fields in a pattern matching should have space surrounding the '=', 1877`` () =
formatSourceString
false
"""
let examineData x =
match data with
| OnePartData(part1 = p1) -> p1
| TwoPartData(part1 = p1; part2=p2) -> p1 + p2"""
config
|> prepend newline
|> should
equal
"""
let examineData x =
match data with
| OnePartData (part1 = p1) -> p1
| TwoPartData (part1 = p1; part2 = p2) -> p1 + p2
"""