Skip to content

Commit

Permalink
Adopt new default for single-case lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
ignasi35 committed Oct 26, 2020
1 parent f2b44a6 commit a50393e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
11 changes: 5 additions & 6 deletions parser/src/test/scala/play/twirl/parser/test/ParserSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ class ParserSpec extends AnyWordSpec with Matchers with Inside {
}

def parseFailure(templateName: String, message: String, line: Int, column: Int) =
inside(parse(templateName)) {
case parser.Error(_, rest, errors) =>
val e = errors.head
e.str mustBe message
e.pos.line mustBe line
e.pos.column mustBe column
inside(parse(templateName)) { case parser.Error(_, rest, errors) =>
val e = errors.head
e.str mustBe message
e.pos.line mustBe line
e.pos.column mustBe column
}

def parseTemplate(templateName: String): Template = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ class TemplateMappingSpec extends AnyWordSpec with Matchers with Inspectors {
10 -> Location(4, 1, 7, "d")
)

forAll(testOffsets) {
case (offset, location) =>
mapping.location(offset) mustBe Some(location)
forAll(testOffsets) { case (offset, location) =>
mapping.location(offset) mustBe Some(location)
}

val testPositions = Seq(
Expand All @@ -63,9 +62,8 @@ class TemplateMappingSpec extends AnyWordSpec with Matchers with Inspectors {
(5, 0) -> Location(4, 1, 7, "d")
)

forAll(testPositions) {
case ((line, column), location) =>
mapping.location(line, column) mustBe Some(location)
forAll(testPositions) { case ((line, column), location) =>
mapping.location(line, column) mustBe Some(location)
}
}
}
Expand Down

0 comments on commit a50393e

Please sign in to comment.