From 2664a5fcb2032c73458df0db73e100281e816c18 Mon Sep 17 00:00:00 2001 From: nojaf Date: Sat, 5 Jun 2021 11:23:40 +0200 Subject: [PATCH] Add regression test for comment above union case in signature file. Fixes #973. --- src/Fantomas.Tests/UnionTests.fs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Fantomas.Tests/UnionTests.fs b/src/Fantomas.Tests/UnionTests.fs index 84e70bdd6f..3e52e8e784 100644 --- a/src/Fantomas.Tests/UnionTests.fs +++ b/src/Fantomas.Tests/UnionTests.fs @@ -795,3 +795,30 @@ type SynBinding = range: range * seqPoint: DebugPointAtBinding """ + +[] +let ``comment above union case in signature file, 973`` () = + formatSourceString + true + """ +namespace foo + +type SynTypeConstraint = + + /// F# syntax: is 'typar: struct + | WhereTyparIsValueType of + typar: SynTypar * + range: range +""" + config + |> prepend newline + |> should + equal + """ +namespace foo + +type SynTypeConstraint = + + /// F# syntax: is 'typar: struct + | WhereTyparIsValueType of typar: SynTypar * range: range +"""