Skip to content

Commit

Permalink
Add regression test for type definition in signature file wrapped wit…
Browse files Browse the repository at this point in the history
…h hash directives. Fixes #1115. (#2025)
  • Loading branch information
nojaf authored Jan 14, 2022
1 parent 46858e7 commit f301041
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Fantomas.Tests/CompilerDirectivesTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2704,3 +2704,31 @@ let x = 1
let x = 1
#endif
"""

[<Test>]
let ``type definition in signature file wrapped with hash directives, 1115`` () =
formatSourceString
true
"""
namespace X
type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * AssemblyReference list
#if !NO_EXTENSIONTYPING
type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted<ITypeProvider> list
#endif
"""
config
|> prepend newline
|> should
equal
"""
namespace X
type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * AssemblyReference list
#if !NO_EXTENSIONTYPING
type ResolvedExtensionReference =
| ResolvedExtensionReference of string * AssemblyReference list * Tainted<ITypeProvider> list
#endif
"""

0 comments on commit f301041

Please sign in to comment.