Skip to content

Commit

Permalink
Add regression test to account for fix of problem in #1407 (#1456)
Browse files Browse the repository at this point in the history
* Add regression test to account for fix of problem in #1407

* Ran format on DotIndexedGetTests.fs

* Remove local .editorconfig that was interfering with formatting

* Add custom config to regression test

Co-authored-by: Florian Verdonck <florian.verdonck@outlook.com>
  • Loading branch information
josh-degraw and nojaf committed Feb 21, 2021
1 parent cf21812 commit 8e72be9
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/Fantomas.Tests/DotIndexedGetTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,35 @@ myList.[7]
otherArgument4
)
"""

[<Test>]
let ``should not merge tokens inside parentheses, 1407`` () =
formatSourceString
false
"""
let inline (=??) x = (=!) x
let mySampleMethod() =
let result = Ok {| Results = [] |}
(Result.okValue result).Results.[0] |> Result.isOk =?? true
"""
{ config with
SpaceBeforeLowercaseInvocation = false
SpaceBeforeColon = true
MaxIfThenElseShortWidth = 25
MultilineBlockBracketsOnSameColumn = true
KeepIfThenInSameLine = true
AlignFunctionSignatureToIndentation = true
AlternativeLongMemberDefinitions = true
MultiLineLambdaClosingNewline = true }
|> prepend newline
|> should
equal
"""
let inline (=??) x = (=!) x
let mySampleMethod () =
let result = Ok {| Results = [] |}
(Result.okValue result).Results.[0] |> Result.isOk
=?? true
"""

0 comments on commit 8e72be9

Please sign in to comment.