Skip to content

Commit

Permalink
Added regression test for long function signature. Fixes #730 (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Apr 19, 2020
1 parent 5b43c13 commit b41b912
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Fantomas.Tests/FunctionDefinitionTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -484,4 +484,35 @@ module FormatCode =
: HttpResponse
=
Http.main CodeFormatter.GetVersion format FormatConfig.FormatConfig.Default log req
"""

[<Test>]
let ``long function signature, 492`` () =
formatSourceString false """
let private addTaskToScheduler (scheduler : IScheduler) taskName taskCron prio (task : unit -> unit) groupName =
let mutable jobDataMap = JobDataMap()
jobDataMap.["task"] <- task
let job =
JobBuilder.Create<WrapperJob>().UsingJobData(jobDataMap)
.WithIdentity(taskName, groupName).Build()
1
""" ({ config with PageWidth = 100 })
|> prepend newline
|> should equal """
let private addTaskToScheduler
(scheduler: IScheduler)
taskName
taskCron
prio
(task: unit -> unit)
groupName
=
let mutable jobDataMap = JobDataMap()
jobDataMap.["task"] <- task
let job =
JobBuilder.Create<WrapperJob>().UsingJobData(jobDataMap).WithIdentity(taskName, groupName)
.Build()
1
"""

0 comments on commit b41b912

Please sign in to comment.