Skip to content

Commit

Permalink
Tests: change generic notation (to not interfere with upcoming feat)
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Oct 22, 2021
1 parent c920701 commit bc9cd6f
Show file tree
Hide file tree
Showing 27 changed files with 261 additions and 261 deletions.
4 changes: 2 additions & 2 deletions src/Fantomas.Tests/AttributeTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ type RoleAdminImportController(akkaService: AkkaService) =
[<HttpPost("jobs/create");
DisableRequestSizeLimit;
RequestFormLimits(MultipartBodyLengthLimit = 509715200L);
ProducesResponseType(typeof<RoleChangeSummaryDto list>, 200);
ProducesResponseType(typeof<list<RoleChangeSummaryDto>>, 200);
ProducesResponseType(404);
Authorize(AuthorizationScopePolicies.Write)>]
member _.StartJob(file: IFormFile, [<FromQuery>] args: ImporterJobArgs) =
Expand Down Expand Up @@ -701,7 +701,7 @@ type RoleAdminImportController(akkaService: AkkaService) =
[<HttpPost("jobs/create");
DisableRequestSizeLimit;
RequestFormLimits(MultipartBodyLengthLimit = 509715200L);
ProducesResponseType(typeof<RoleChangeSummaryDto list>, 200);
ProducesResponseType(typeof<list<RoleChangeSummaryDto>>, 200);
ProducesResponseType(404);
Authorize(AuthorizationScopePolicies.Write)>]
member _.StartJob(file: IFormFile, [<FromQuery>] args: ImporterJobArgs) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ let ``multiline DU case`` () =
[<NoEquality; NoComparison>]
type SynBinding =
SynBinding of
accessibility: SynAccess option *
accessibility: option<SynAccess> *
kind: SynBindingKind *
mustInline: bool *
isMutable: bool *
attributes: SynAttributes *
xmlDoc: PreXmlDoc *
valData: SynValData *
headPat: SynPat *
returnInfo: SynBindingReturnInfo option *
returnInfo: option<SynBindingReturnInfo> *
expr: SynExpr *
range: range *
seqPoint: DebugPointAtBinding
Expand All @@ -84,15 +84,15 @@ type SynBinding =
[<NoEquality; NoComparison>]
type SynBinding =
| SynBinding of
accessibility: SynAccess option *
accessibility: option<SynAccess> *
kind: SynBindingKind *
mustInline: bool *
isMutable: bool *
attributes: SynAttributes *
xmlDoc: PreXmlDoc *
valData: SynValData *
headPat: SynPat *
returnInfo: SynBindingReturnInfo option *
returnInfo: option<SynBindingReturnInfo> *
expr: SynExpr *
range: range *
seqPoint: DebugPointAtBinding
Expand Down
12 changes: 6 additions & 6 deletions src/Fantomas.Tests/BlankLinesAroundNestedMultilineExpressions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,15 @@ let ``recursive types`` () =
formatSourceString
false
"""
type Cmd<'msg> = Cmd'<'msg> list
type Cmd<'msg> = list<Cmd'<'msg>>
and private Cmd'<'msg> = Send<'msg> -> unit
"""
config
|> prepend newline
|> should
equal
"""
type Cmd<'msg> = Cmd'<'msg> list
type Cmd<'msg> = list<Cmd'<'msg>>
and private Cmd'<'msg> = Send<'msg> -> unit
"""

Expand All @@ -268,7 +268,7 @@ let ``multiline recursive types`` () =
false
"""
type ViewBinding<'model,'msg> = string * Variable<'model,'msg>
and ViewBindings<'model,'msg> = ViewBinding<'model,'msg> list
and ViewBindings<'model,'msg> = list<ViewBinding<'model,'msg>>
and Variable<'model,'msg> =
| Bind of Getter<'model>
| BindTwoWay of Getter<'model> * Setter<'model,'msg>
Expand All @@ -283,7 +283,7 @@ and Variable<'model,'msg> =
equal
"""
type ViewBinding<'model, 'msg> = string * Variable<'model, 'msg>
and ViewBindings<'model, 'msg> = ViewBinding<'model, 'msg> list
and ViewBindings<'model, 'msg> = list<ViewBinding<'model, 'msg>>
and Variable<'model, 'msg> =
| Bind of Getter<'model>
| BindTwoWay of Getter<'model> * Setter<'model, 'msg>
Expand All @@ -300,7 +300,7 @@ let ``recursive types in signature file`` () =
"""
namespace Foobar
type Cmd<'msg> = Cmd'<'msg> list
type Cmd<'msg> = list<Cmd'<'msg>>
and private Cmd'<'msg> = Send<'msg> -> unit
"""
config
Expand All @@ -310,6 +310,6 @@ and private Cmd'<'msg> = Send<'msg> -> unit
"""
namespace Foobar
type Cmd<'msg> = Cmd'<'msg> list
type Cmd<'msg> = list<Cmd'<'msg>>
and private Cmd'<'msg> = Send<'msg> -> unit
"""
24 changes: 12 additions & 12 deletions src/Fantomas.Tests/ClassTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ let ``recursive classes`` () =
"""
type Folder(pathIn: string) =
let path = pathIn
let filenameArray : string array = System.IO.Directory.GetFiles(path)
let filenameArray : array<string> = System.IO.Directory.GetFiles(path)
member this.FileArray = Array.map (fun elem -> new File(elem, this)) filenameArray
and File(filename: string, containingFolder: Folder) =
Expand All @@ -265,7 +265,7 @@ and File(filename: string, containingFolder: Folder) =
"""
type Folder(pathIn: string) =
let path = pathIn
let filenameArray: string array = System.IO.Directory.GetFiles(path)
let filenameArray: array<string> = System.IO.Directory.GetFiles(path)
member this.FileArray = Array.map (fun elem -> new File(elem, this)) filenameArray
and File(filename: string, containingFolder: Folder) =
Expand Down Expand Up @@ -348,20 +348,20 @@ let ``should keep parens in class inheritance in the right place`` () =
let ``should keep type annotations on auto properties`` () =
formatSourceString
false
"""type Document(id : string, library : string, name : string option) =
"""type Document(id : string, library : string, name : option<string>) =
member val ID = id
member val Library = library
member val Name = name with get, set
member val LibraryID : string option = None with get, set
member val LibraryID : option<string> = None with get, set
"""
config
|> should
equal
"""type Document(id: string, library: string, name: string option) =
"""type Document(id: string, library: string, name: option<string>) =
member val ID = id
member val Library = library
member val Name = name with get, set
member val LibraryID: string option = None with get, set
member val LibraryID: option<string> = None with get, set
"""

[<Test>]
Expand Down Expand Up @@ -843,7 +843,7 @@ let ``comment before multiline class member`` () =
type MaybeBuilder () =
member inline __.Bind
// meh
(value, binder : 'T -> 'U option) : 'U option =
(value, binder : 'T -> option<'U>) : option<'U> =
Option.bind binder value
"""
config
Expand All @@ -856,8 +856,8 @@ type MaybeBuilder() =
// meh
(
value,
binder: 'T -> 'U option
) : 'U option =
binder: 'T -> option<'U>
) : option<'U> =
Option.bind binder value
"""

Expand All @@ -874,7 +874,7 @@ type MaybeBuilder () =
#else
member inline __.Bind
#endif
(value, binder : 'T -> 'U option) : 'U option =
(value, binder : 'T -> option<'U>) : option<'U> =
Option.bind binder value
"""
config
Expand All @@ -892,8 +892,8 @@ type MaybeBuilder() =
#endif
(
value,
binder: 'T -> 'U option
) : 'U option =
binder: 'T -> option<'U>
) : option<'U> =
Option.bind binder value
"""

Expand Down
16 changes: 8 additions & 8 deletions src/Fantomas.Tests/CommentTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let ``comments on local let bindings`` () =
let print_30_permut() =
/// declare and initialize
let permutation : int array = Array.init n (fun i -> Console.Write(i+1); i)
let permutation : array<int> = Array.init n (fun i -> Console.Write(i+1); i)
permutation
"""
config
Expand All @@ -51,7 +51,7 @@ let print_30_permut() =
let print_30_permut () =
/// declare and initialize
let permutation: int array =
let permutation: array<int> =
Array.init
n
(fun i ->
Expand All @@ -69,7 +69,7 @@ let ``comments on local let bindings with desugared lambda`` () =
let print_30_permut() =
/// declare and initialize
let permutation : int array = Array.init n (fun (i,j) -> Console.Write(i+1); i)
let permutation : array<int> = Array.init n (fun (i,j) -> Console.Write(i+1); i)
permutation
"""
config
Expand All @@ -80,7 +80,7 @@ let print_30_permut() =
let print_30_permut () =
/// declare and initialize
let permutation: int array =
let permutation: array<int> =
Array.init
n
(fun (i, j) ->
Expand Down Expand Up @@ -344,7 +344,7 @@ type IlxGenOptions =
workAroundReflectionEmitBugs: bool
emitConstantArraysUsingStaticDataBlobs: bool
// If this is set, then the last module becomes the "main" module and its toplevel bindings are executed at startup
mainMethodInfo: Tast.Attribs option
mainMethodInfo: option<Tast.Attribs>
localOptimizationsAreOn: bool
generateDebugSymbols: bool
testFlagEmitFeeFeeAs100001: bool
Expand Down Expand Up @@ -374,7 +374,7 @@ type IlxGenOptions =
workAroundReflectionEmitBugs: bool;
emitConstantArraysUsingStaticDataBlobs: bool;
// If this is set, then the last module becomes the "main" module and its toplevel bindings are executed at startup
mainMethodInfo: Tast.Attribs option;
mainMethodInfo: option<Tast.Attribs>;
localOptimizationsAreOn: bool;
generateDebugSymbols: bool;
testFlagEmitFeeFeeAs100001: bool;
Expand Down Expand Up @@ -1023,7 +1023,7 @@ let ``multiple line comments form a single trivia`` () =
/// more freedom about typechecking these expressions.
/// LongIdent can be empty list - it is used to denote that name of some AST element is absent (i.e. empty type name in inherit)
type LongIdentWithDots =
| LongIdentWithDots of id: LongIdent * dotms: range list
| LongIdentWithDots of id: LongIdent * dotms: list<range>
"""
config
|> prepend newline
Expand All @@ -1037,7 +1037,7 @@ type LongIdentWithDots =
/// if dotms.Length = lid.Length, then the parser must have reported an error, so the typechecker is allowed
/// more freedom about typechecking these expressions.
/// LongIdent can be empty list - it is used to denote that name of some AST element is absent (i.e. empty type name in inherit)
type LongIdentWithDots = LongIdentWithDots of id: LongIdent * dotms: range list
type LongIdentWithDots = LongIdentWithDots of id: LongIdent * dotms: list<range>
"""

[<Test>]
Expand Down
16 changes: 8 additions & 8 deletions src/Fantomas.Tests/CompilerDirectivesTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ let ``some spacing is still lost in and around #if blocks, 303`` () =
formatSourceString
false
"""
let internal UpdateStrongNaming (assembly : AssemblyDefinition) (key : StrongNameKeyPair option) =
let internal UpdateStrongNaming (assembly : AssemblyDefinition) (key : option<StrongNameKeyPair>) =
let assemblyName = assembly.Name
#if NETCOREAPP2_0
do
Expand All @@ -498,7 +498,7 @@ let ``some spacing is still lost in and around #if blocks, 303`` () =
|> should
equal
"""
let internal UpdateStrongNaming (assembly: AssemblyDefinition) (key: StrongNameKeyPair option) =
let internal UpdateStrongNaming (assembly: AssemblyDefinition) (key: option<StrongNameKeyPair>) =
let assemblyName = assembly.Name
#if NETCOREAPP2_0
do
Expand All @@ -523,7 +523,7 @@ let ``some spacing is still lost in and around #if blocks, no defines`` () =
formatSourceStringWithDefines
[]
"""
let internal UpdateStrongNaming (assembly : AssemblyDefinition) (key : StrongNameKeyPair option) =
let internal UpdateStrongNaming (assembly : AssemblyDefinition) (key : option<StrongNameKeyPair>) =
let assemblyName = assembly.Name
#if NETCOREAPP2_0
do
Expand All @@ -547,7 +547,7 @@ let ``some spacing is still lost in and around #if blocks, no defines`` () =
|> should
equal
"""
let internal UpdateStrongNaming (assembly: AssemblyDefinition) (key: StrongNameKeyPair option) =
let internal UpdateStrongNaming (assembly: AssemblyDefinition) (key: option<StrongNameKeyPair>) =
let assemblyName = assembly.Name
#if NETCOREAPP2_0
Expand All @@ -572,7 +572,7 @@ let ``some spacing is still lost in and around #if blocks, NETCOREAPP2_0`` () =
formatSourceStringWithDefines
[ "NETCOREAPP2_0" ]
"""
let internal UpdateStrongNaming (assembly : AssemblyDefinition) (key : StrongNameKeyPair option) =
let internal UpdateStrongNaming (assembly : AssemblyDefinition) (key : option<StrongNameKeyPair>) =
let assemblyName = assembly.Name
#if NETCOREAPP2_0
do
Expand All @@ -596,7 +596,7 @@ let ``some spacing is still lost in and around #if blocks, NETCOREAPP2_0`` () =
|> should
equal
"""
let internal UpdateStrongNaming (assembly: AssemblyDefinition) (key: StrongNameKeyPair option) =
let internal UpdateStrongNaming (assembly: AssemblyDefinition) (key: option<StrongNameKeyPair>) =
let assemblyName = assembly.Name
#if NETCOREAPP2_0
do
Expand Down Expand Up @@ -2311,7 +2311,7 @@ let ``directive above SynExpr.Do, 1333`` () =
module ReactHookExtensions =
type React with
[<Hook>]
static member useDeferred(operation: Async<'T>, dependencies: obj array) =
static member useDeferred(operation: Async<'T>, dependencies: array<obj>) =
let (deferred, setDeferred) = React.useState(Deferred.HasNotStartedYet)
let token = React.useCancellationToken()
let executeOperation = async {
Expand Down Expand Up @@ -2339,7 +2339,7 @@ module ReactHookExtensions =
module ReactHookExtensions =
type React with
[<Hook>]
static member useDeferred(operation: Async<'T>, dependencies: obj array) =
static member useDeferred(operation: Async<'T>, dependencies: array<obj>) =
let (deferred, setDeferred) =
React.useState (Deferred.HasNotStartedYet)
Expand Down
Loading

0 comments on commit bc9cd6f

Please sign in to comment.