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 fsprojects#1115. (fsprojects#2025)
  • Loading branch information
nojaf authored and jindraivanek committed Mar 30, 2022
1 parent 8bc4432 commit 716bcec
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 716bcec

Please sign in to comment.