Skip to content

Commit

Permalink
Add regression test for comment after match keyword. Fixes fsprojects…
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf authored and jindraivanek committed Mar 30, 2022
1 parent a239de1 commit 74e591b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed
* Comment after equals is remove in anonymous record. [#1921](https://github.com/fsprojects/fantomas/issues/1921)
* Comment after equals in record type is lost. [#2001](https://github.com/fsprojects/fantomas/issues/2001)
* Comment after match keyword is lost. [#1851](https://github.com/fsprojects/fantomas/issues/1851)

## [4.7.0] - 2022-03-04

Expand Down
27 changes: 27 additions & 0 deletions src/Fantomas.Tests/PatternMatchingTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2123,3 +2123,30 @@ match!
match! a with // foo
| B b -> ()
"""

[<Test>]
let ``comment after match keyword, 1851`` () =
formatSourceString
false
"""
match // foo
a with
| _ -> ()
match! // foo!
a with
| _ -> ()
"""
config
|> prepend newline
|> should
equal
"""
match // foo
a with
| _ -> ()
match! // foo!
a with
| _ -> ()
"""

0 comments on commit 74e591b

Please sign in to comment.