Skip to content

Commit

Permalink
Add regression test for 1869 (#2565)
Browse files Browse the repository at this point in the history
  • Loading branch information
dawedawe authored Oct 8, 2022
1 parent b0eea04 commit 4f4d646
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed
* Overly aggressive de-indentation. [#2110](https://github.com/fsprojects/fantomas/issues/2110)
* Broken comma in match expression in parameter invocation. [#1869](https://github.com/fsprojects/fantomas/issues/1869)

## [5.0.5] - 2022-10-07

Expand Down
53 changes: 53 additions & 0 deletions src/Fantomas.Core.Tests/AppTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1064,3 +1064,56 @@ printf "%-40s %s" "" (*<--flags*) word
"""
printf "%-40s %s" "" (*<--flags*) word
"""

[<Test>]
let ``broken comma in match expression in parameter invocation, 1869`` () =
formatSourceString
false
"""
module Utils
type U = A of int | B of string
type C() =
member this.M (a : int, b : string) = ()
let f () =
let u = A 0
do C().M(
match u with
| A i -> i
| B _ -> 0
,
match u with
| A _ -> ""
| B s -> s
)
"""
config
|> prepend newline
|> should
equal
"""
module Utils
type U =
| A of int
| B of string
type C() =
member this.M(a: int, b: string) = ()
let f () =
let u = A 0
do
C()
.M(
match u with
| A i -> i
| B _ -> 0
, match u with
| A _ -> ""
| B s -> s
)
"""

0 comments on commit 4f4d646

Please sign in to comment.