Skip to content

Commit

Permalink
Test braces around func w/ single typed parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 10, 2024
1 parent b55f7d7 commit e9ac8b6
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7529,3 +7529,38 @@ tag match
case TYPEREFsymbol | TYPEREFdirect | TERMREFsymbol | TERMREFdirect =>
node.refPrivate = in0.readByte() == PRIVATE;
case _ =>
<<< #4133 lambda in parens rewritten to braces
maxColumn = 80
rewrite {
rules = [RedundantBraces]
scala3.removeOptionalBraces = yes
}
===
object Build {
lazy val scaladoc = project.in(file("scaladoc")).
settings(
generateScalaDocumentation := Def.inputTaskDyn {
val outputDirOverride = extraArgs.headOption.fold(identity[GenerationConfig](_))(newDir => {
config: GenerationConfig => config.add(OutputDir(newDir))
})
val justAPI = justAPIArg.fold(identity[GenerationConfig](_))(_ => {
config: GenerationConfig => config.remove[SiteRoot]
})
}.evaluated,
)
}
>>>
object Build:
lazy val scaladoc = project
.in(file("scaladoc"))
.settings(
generateScalaDocumentation := Def.inputTaskDyn {
val outputDirOverride =
extraArgs.headOption.fold(identity[GenerationConfig](_)) {
newDir => config: GenerationConfig => config.add(OutputDir(newDir))
}
val justAPI = justAPIArg.fold(identity[GenerationConfig](_)) {
_ => config: GenerationConfig => config.remove[SiteRoot]
}
}.evaluated
)
Original file line number Diff line number Diff line change
Expand Up @@ -7243,3 +7243,36 @@ tag match
case TYPEREFsymbol | TYPEREFdirect | TERMREFsymbol | TERMREFdirect =>
node.refPrivate = in0.readByte() == PRIVATE;
case _ =>
<<< #4133 lambda in parens rewritten to braces
maxColumn = 80
rewrite {
rules = [RedundantBraces]
scala3.removeOptionalBraces = yes
}
===
object Build {
lazy val scaladoc = project.in(file("scaladoc")).
settings(
generateScalaDocumentation := Def.inputTaskDyn {
val outputDirOverride = extraArgs.headOption.fold(identity[GenerationConfig](_))(newDir => {
config: GenerationConfig => config.add(OutputDir(newDir))
})
val justAPI = justAPIArg.fold(identity[GenerationConfig](_))(_ => {
config: GenerationConfig => config.remove[SiteRoot]
})
}.evaluated,
)
}
>>>
Idempotency violated
=> Diff (- obtained, + expected)
}
- val justAPI = justAPIArg.fold(identity[GenerationConfig](_)) { _ =>
- config: GenerationConfig =>
- config.remove[SiteRoot]
- }
+ val justAPI = justAPIArg
+ .fold(identity[GenerationConfig](_)) { _ => config: GenerationConfig =>
+ config.remove[SiteRoot]
+ }
}.evaluated)
Original file line number Diff line number Diff line change
Expand Up @@ -7558,3 +7558,37 @@ tag match
case TYPEREFsymbol | TYPEREFdirect | TERMREFsymbol | TERMREFdirect =>
node.refPrivate = in0.readByte() == PRIVATE;
case _ =>
<<< #4133 lambda in parens rewritten to braces
maxColumn = 80
rewrite {
rules = [RedundantBraces]
scala3.removeOptionalBraces = yes
}
===
object Build {
lazy val scaladoc = project.in(file("scaladoc")).
settings(
generateScalaDocumentation := Def.inputTaskDyn {
val outputDirOverride = extraArgs.headOption.fold(identity[GenerationConfig](_))(newDir => {
config: GenerationConfig => config.add(OutputDir(newDir))
})
val justAPI = justAPIArg.fold(identity[GenerationConfig](_))(_ => {
config: GenerationConfig => config.remove[SiteRoot]
})
}.evaluated,
)
}
>>>
object Build:
lazy val scaladoc = project.in(file("scaladoc")).
settings(
generateScalaDocumentation := Def.inputTaskDyn {
val outputDirOverride =
extraArgs.headOption.fold(identity[GenerationConfig](_)) {
newDir => config: GenerationConfig => config.add(OutputDir(newDir))
}
val justAPI = justAPIArg.fold(identity[GenerationConfig](_)) {
_ => config: GenerationConfig => config.remove[SiteRoot]
}
}.evaluated
)
Original file line number Diff line number Diff line change
Expand Up @@ -7838,3 +7838,42 @@ tag match
case TYPEREFsymbol | TYPEREFdirect | TERMREFsymbol | TERMREFdirect =>
node.refPrivate = in0.readByte() == PRIVATE;
case _ =>
<<< #4133 lambda in parens rewritten to braces
maxColumn = 80
rewrite {
rules = [RedundantBraces]
scala3.removeOptionalBraces = yes
}
===
object Build {
lazy val scaladoc = project.in(file("scaladoc")).
settings(
generateScalaDocumentation := Def.inputTaskDyn {
val outputDirOverride = extraArgs.headOption.fold(identity[GenerationConfig](_))(newDir => {
config: GenerationConfig => config.add(OutputDir(newDir))
})
val justAPI = justAPIArg.fold(identity[GenerationConfig](_))(_ => {
config: GenerationConfig => config.remove[SiteRoot]
})
}.evaluated,
)
}
>>>
Idempotency violated
=> Diff (- obtained, + expected)
.headOption
- .fold(identity[GenerationConfig](_)) { newDir =>
- config: GenerationConfig =>
- config.add(OutputDir(newDir))
+ .fold(identity[GenerationConfig](_)) {
+ newDir => config: GenerationConfig =>
+ config.add(OutputDir(newDir))
}
val justAPI =
- justAPIArg.fold(identity[GenerationConfig](_)) { _ =>
- config: GenerationConfig =>
- config.remove[SiteRoot]
+ justAPIArg.fold(identity[GenerationConfig](_)) {
+ _ => config: GenerationConfig =>
+ config.remove[SiteRoot]
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class FormatTests extends FunSuite with CanRunTests with FormatAssertions {
val explored = Debug.explored.get()
logger.debug(s"Total explored: $explored")
if (!onlyUnit && !onlyManual)
assertEquals(explored, 1114736, "total explored")
assertEquals(explored, 1119018, "total explored")
val results = debugResults.result()
// TODO(olafur) don't block printing out test results.
// I don't want to deal with scalaz's Tasks :'(
Expand Down

0 comments on commit e9ac8b6

Please sign in to comment.