Skip to content

Commit

Permalink
UT for one of the VariableShadowing UTs reported in scapegoat-scala#389
Browse files Browse the repository at this point in the history
  • Loading branch information
mccartney authored Sep 29, 2020
1 parent f0fb308 commit a279233
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,25 @@ class VariableShadowingTest extends InspectionTest {
compileCodeSnippet(code)
compiler.scapegoat.feedback.warnings.size shouldBe 0
}
"when using Builder-pattern method chaining (#398)" in {
val code =
"""
|object Test {
|
| def f(x: Int): String = x.toString
| def g(y: String): Int = y.toInt
|
| val a = Seq(1, 2, 3)
| System.out.println(
| a
| .map(s => f(s))
| .map(s => g(s))
| )
|}
|""".stripMargin
compileCodeSnippet(code)
compiler.scapegoat.feedback.warnings.size shouldBe 0
}
}
}
}

0 comments on commit a279233

Please sign in to comment.