Skip to content

Commit

Permalink
Test multiline string as case body
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Oct 12, 2024
1 parent 56ff03a commit 51adf57
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10487,3 +10487,19 @@ abstract class MacroBenchmark(parallel: Boolean, maxFiles: Int)
extends FormatBenchmark {
var files: GenIterable[String] = _
}
<<< #4133 multiline string as case body
maxColumn = 80
===
val output = evaluated match {
case s: String =>
s"""|
|"$s"""".stripMargin
case x => x.toString
}
>>>
val output = evaluated match {
case s: String =>
s"""|
|"$s"""".stripMargin
case x => x.toString
}
16 changes: 16 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 @@ -9796,3 +9796,19 @@ abstract class MacroBenchmark(parallel: Boolean, maxFiles: Int)
extends FormatBenchmark {
var files: GenIterable[String] = _
}
<<< #4133 multiline string as case body
maxColumn = 80
===
val output = evaluated match {
case s: String =>
s"""|
|"$s"""".stripMargin
case x => x.toString
}
>>>
val output = evaluated match {
case s: String =>
s"""|
|"$s"""".stripMargin
case x => x.toString
}
16 changes: 16 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 @@ -10236,3 +10236,19 @@ abstract class MacroBenchmark(parallel: Boolean, maxFiles: Int)
extends FormatBenchmark {
var files: GenIterable[String] = _
}
<<< #4133 multiline string as case body
maxColumn = 80
===
val output = evaluated match {
case s: String =>
s"""|
|"$s"""".stripMargin
case x => x.toString
}
>>>
val output = evaluated match {
case s: String =>
s"""|
|"$s"""".stripMargin
case x => x.toString
}
Original file line number Diff line number Diff line change
Expand Up @@ -10611,3 +10611,21 @@ abstract class MacroBenchmark(parallel: Boolean, maxFiles: Int)
extends FormatBenchmark {
var files: GenIterable[String] = _
}
<<< #4133 multiline string as case body
maxColumn = 80
===
val output = evaluated match {
case s: String =>
s"""|
|"$s"""".stripMargin
case x => x.toString
}
>>>
val output =
evaluated match {
case s: String =>
s"""|
|"$s"""".stripMargin
case x =>
x.toString
}

0 comments on commit 51adf57

Please sign in to comment.