Skip to content

Commit

Permalink
Add string tests with breaks in interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Jun 19, 2024
1 parent d2d2171 commit 1fbac8f
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions scalafmt-tests/src/test/resources/default/String.stat
Original file line number Diff line number Diff line change
Expand Up @@ -630,3 +630,81 @@ println(
|A very long string
|with multiple lines
|""".stripMargin)
<<< #4067 avoid classic
preset = default
maxColumn = 120
newlines {
inInterpolation = avoid
}
===
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
>>>
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
<<< #4067 avoid keep
preset = default
maxColumn = 120
newlines {
inInterpolation = avoid
source = keep
}
===
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
>>>
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x
.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
<<< #4067 avoid fold
preset = default
maxColumn = 120
newlines {
inInterpolation = avoid
source = fold
}
===
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
>>>
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x
.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
<<< #4067 avoid unfold
preset = default
maxColumn = 120
newlines {
inInterpolation = avoid
source = unfold
}
===
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}
>>>
object a {
throw new Exception(
s"Can't create a new SpecialThingamer when forwarding without specialUserId/specialDetails. SpecialUserID: ${x
.maybeSpecialUserId}, Special details count: ${maybeSpecialDetails.map(_.length).getOrElse(0)}"
)
}

0 comments on commit 1fbac8f

Please sign in to comment.