forked from fsprojects/fantomas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpecialConstructsTests.fs
47 lines (41 loc) · 990 Bytes
/
SpecialConstructsTests.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module Fantomas.Tests.SpecialConstructsTests
open NUnit.Framework
open FsUnit
open Fantomas.Tests.TestHelper
[<Test>]
let ``embedded IL`` () =
formatSourceString
false
"""
let inline private retype<'T, 'U> (x : 'T) : 'U = (# "" x : 'U #)"""
config
|> prepend newline
|> should
equal
"""
let inline private retype<'T, 'U> (x: 'T) : 'U = (# "" x : 'U #)
"""
[<Test>]
let ``don't add whitespace in chained accessors, 566`` () =
formatSourceString
false
"""type F =
abstract G : int list -> Map<int, int>
let x : F = { new F with member __.G _ = Map.empty }
x.G[].TryFind 3
"""
{ config with
SpaceAfterComma = false
SpaceAfterSemicolon = false
SpaceAroundDelimiter = false }
|> prepend newline
|> should
equal
"""
type F =
abstract G: int list -> Map<int,int>
let x: F =
{new F with
member __.G _ = Map.empty}
x.G[].TryFind 3
"""