From ed813aa4afd2f327292adc1a71e78de1db58979e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Tue, 29 Sep 2020 21:49:01 +0200 Subject: [PATCH] UT for one of the VariableShadowing UTs reported in #389 --- .../inspections/VariableShadowingTest.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala b/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala index af0a3c92..09766015 100644 --- a/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala +++ b/src/test/scala/com/sksamuel/scapegoat/inspections/VariableShadowingTest.scala @@ -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 + } } } }