Skip to content

Commit

Permalink
Add regression test for cons pattern in let binding (#1996) (#2891)
Browse files Browse the repository at this point in the history
* Add regression test for cons pattern in let binding (#1996)

* Correct test.

* Add changelog entry

---------

Co-authored-by: nojaf <[email protected]>
  • Loading branch information
clkbug and nojaf authored Jun 2, 2023
1 parent 6424a61 commit bfb4afc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

### Fixed
* Missing space before arrow. [#2888](https://github.com/fsprojects/fantomas/issues/2888)
* Cons pattern in let bindings is converted to invalid code. [#1996](https://github.com/fsprojects/fantomas/issues/1996)

## [6.0.3] - 2023-05-14

Expand Down
15 changes: 15 additions & 0 deletions src/Fantomas.Core.Tests/LetBindingTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2165,3 +2165,18 @@ let x
) =
print "hello"
"""

[<Test>]
let ``cons pattern in let binding, 1996`` () =
formatSourceString
false
"""
let x::y = []
"""
config
|> prepend newline
|> should
equal
"""
let x :: y = []
"""

0 comments on commit bfb4afc

Please sign in to comment.