-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add inline keyword to PropertyGetSetBindingNode.
- Loading branch information
Showing
6 changed files
with
116 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
module Fantomas.Core.Tests.InlineTests | ||
|
||
open NUnit.Framework | ||
open FsUnit | ||
open Fantomas.Core.Tests.TestHelper | ||
|
||
[<Test>] | ||
let ``trivia around inline keyword, 2017`` () = | ||
formatSourceString | ||
false | ||
""" | ||
let | ||
#if !DEBUG | ||
inline | ||
#endif | ||
map f ar = Async.map (Result.map f) ar | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
let | ||
#if !DEBUG | ||
inline | ||
#endif | ||
map | ||
f | ||
ar | ||
= | ||
Async.map (Result.map f) ar | ||
""" | ||
|
||
[<Test>] | ||
let ``inline in plain member`` () = | ||
formatSourceString | ||
false | ||
""" | ||
type X = | ||
member inline x.Y () = () | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
type X = | ||
member inline x.Y() = () | ||
""" | ||
|
||
[<Test>] | ||
let ``inline in get/set member`` () = | ||
formatSourceString | ||
false | ||
""" | ||
type X = | ||
member inline x.Y | ||
with inline get () = 4 | ||
and inline set y = () | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
type X = | ||
member inline x.Y | ||
with inline get () = 4 | ||
and inline set y = () | ||
""" | ||
|
||
[<Test>] | ||
let ``inline in val`` () = | ||
formatSourceString | ||
true | ||
""" | ||
val inline meh: int -> int | ||
""" | ||
config | ||
|> prepend newline | ||
|> should | ||
equal | ||
""" | ||
val inline meh: int -> int | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters