Skip to content

Commit

Permalink
Add regression test for xml doc before recursive type.
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Dec 26, 2022
1 parent 914dbf1 commit 9e3be04
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions src/Fantomas.Core.Tests/TypeDeclarationTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3368,3 +3368,44 @@ module Primitives =
#endif
BlockHeightOffset16 = BlockHeightOffset16 of uint16
"""

[<Test>]
let ``xml doc before recursive type, 2360`` () =
formatSourceString
false
"""
module Primitives =
type BlockHeight =
| BlockHeight of uint32
/// **Description**
///
/// 16bit relative block height used for `OP_CSV` locks,
/// Since OP_CSV allow only block number of 0 ~ 65535, it is safe
/// to restrict into the range smaller than BlockHeight
and
#if !NoDUsAsStructs
[<Struct>]
#endif
BlockHeightOffset16 =
| BlockHeightOffset16 of uint16
"""
config
|> prepend newline
|> should
equal
"""
module Primitives =
type BlockHeight = BlockHeight of uint32
/// **Description**
///
/// 16bit relative block height used for `OP_CSV` locks,
/// Since OP_CSV allow only block number of 0 ~ 65535, it is safe
/// to restrict into the range smaller than BlockHeight
and
#if !NoDUsAsStructs
[<Struct>]
#endif
BlockHeightOffset16 = BlockHeightOffset16 of uint16
"""

0 comments on commit 9e3be04

Please sign in to comment.