Skip to content

Commit

Permalink
Test select with apply in braces and single func
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Nov 25, 2024
1 parent 2ae3560 commit f0975ba
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11291,3 +11291,37 @@ object a {
quux(x)
}
}
<<< #4133 select with braced apply and single function arg, !parensForOneLineApply
maxColumn = 74
newlines {
avoidForSimpleOverflow = [punct, slc, tooLong]
ignoreInSyntax = false
}
rewrite.rules = [RedundantBraces]
rewrite.redundantBraces.parensForOneLineApply = false
===
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
>>>
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy {
x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
<<< #4133 select with braced apply and single function arg, parensForOneLineApply
maxColumn = 74
newlines {
avoidForSimpleOverflow = [punct, slc, tooLong]
ignoreInSyntax = false
}
rewrite.rules = [RedundantBraces]
rewrite.redundantBraces.parensForOneLineApply = true
===
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
>>>
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy {
x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
33 changes: 33 additions & 0 deletions scalafmt-tests/shared/src/test/resources/newlines/source_fold.stat
Original file line number Diff line number Diff line change
Expand Up @@ -10532,3 +10532,36 @@ object a {
quux(x)
}
}
<<< #4133 select with braced apply and single function arg, !parensForOneLineApply
maxColumn = 74
newlines {
avoidForSimpleOverflow = [punct, slc, tooLong]
ignoreInSyntax = false
}
rewrite.rules = [RedundantBraces]
rewrite.redundantBraces.parensForOneLineApply = false
===
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
>>>
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy {
x => (x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
<<< #4133 select with braced apply and single function arg, parensForOneLineApply
maxColumn = 74
newlines {
avoidForSimpleOverflow = [punct, slc, tooLong]
ignoreInSyntax = false
}
rewrite.rules = [RedundantBraces]
rewrite.redundantBraces.parensForOneLineApply = true
===
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
>>>
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest)
.sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
34 changes: 34 additions & 0 deletions scalafmt-tests/shared/src/test/resources/newlines/source_keep.stat
Original file line number Diff line number Diff line change
Expand Up @@ -11043,3 +11043,37 @@ object a {
quux(x)
}
}
<<< #4133 select with braced apply and single function arg, !parensForOneLineApply
maxColumn = 74
newlines {
avoidForSimpleOverflow = [punct, slc, tooLong]
ignoreInSyntax = false
}
rewrite.rules = [RedundantBraces]
rewrite.redundantBraces.parensForOneLineApply = false
===
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
>>>
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy {
x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
<<< #4133 select with braced apply and single function arg, parensForOneLineApply
maxColumn = 74
newlines {
avoidForSimpleOverflow = [punct, slc, tooLong]
ignoreInSyntax = false
}
rewrite.rules = [RedundantBraces]
rewrite.redundantBraces.parensForOneLineApply = true
===
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
>>>
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy {
x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
Original file line number Diff line number Diff line change
Expand Up @@ -11471,3 +11471,39 @@ object a {
quux(x)
}
}
<<< #4133 select with braced apply and single function arg, !parensForOneLineApply
maxColumn = 74
newlines {
avoidForSimpleOverflow = [punct, slc, tooLong]
ignoreInSyntax = false
}
rewrite.rules = [RedundantBraces]
rewrite.redundantBraces.parensForOneLineApply = false
===
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
>>>
topLevelStatementBlankLines
.filter(x => x.minNest <= x.maxNest)
.sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
<<< #4133 select with braced apply and single function arg, parensForOneLineApply
maxColumn = 74
newlines {
avoidForSimpleOverflow = [punct, slc, tooLong]
ignoreInSyntax = false
}
rewrite.rules = [RedundantBraces]
rewrite.redundantBraces.parensForOneLineApply = true
===
topLevelStatementBlankLines.filter(x => x.minNest <= x.maxNest).sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
>>>
topLevelStatementBlankLines
.filter(x => x.minNest <= x.maxNest)
.sortBy { x =>
(x.minBreaks, x.maxNest, -x.minNest, x.regex.fold(0)(-_.length))
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,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, 1183844, "total explored")
assertEquals(explored, 1184830, "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 f0975ba

Please sign in to comment.