From dd532cf976ea005916f0883921e5f669c734424e Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Thu, 26 Dec 2024 15:03:38 -0500 Subject: [PATCH] Fix contains --- src/sbt-test/sbt-buildinfo/caseclassrenderer/build.sbt | 2 +- src/sbt-test/sbt-buildinfo/constantvalue/build.sbt | 4 ++-- .../sbt-buildinfo/javasingletonrenderer/build.sbt | 3 ++- .../sbt-buildinfo/javastaticfieldsrenderer/build.sbt | 3 ++- src/sbt-test/sbt-buildinfo/simple/build.sbt | 8 ++++---- src/sbt-test/sbt-buildinfo/skipimportscaseclass/build.sbt | 2 +- src/sbt-test/sbt-buildinfo/usepackageaspath/build.sbt | 2 +- 7 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/sbt-test/sbt-buildinfo/caseclassrenderer/build.sbt b/src/sbt-test/sbt-buildinfo/caseclassrenderer/build.sbt index cf8bca7..0b6c52f 100644 --- a/src/sbt-test/sbt-buildinfo/caseclassrenderer/build.sbt +++ b/src/sbt-test/sbt-buildinfo/caseclassrenderer/build.sbt @@ -120,7 +120,7 @@ lazy val root = (project in file(".")) """ val get = apply()""" :: """ val value = apply()""" :: """}""" :: - """// $COVERAGE-ON$""" :: Nil if (targetInfo contains "target = new java.io.File(") && + """// $COVERAGE-ON$""" :: Nil if (targetInfo.contains("target = new java.io.File(")) && (apiMappingsDecl.contains("apiMappings")) => case _ => sys.error("unexpected output: \n" + lines.mkString("\n")) } diff --git a/src/sbt-test/sbt-buildinfo/constantvalue/build.sbt b/src/sbt-test/sbt-buildinfo/constantvalue/build.sbt index f951b5f..d731c7f 100644 --- a/src/sbt-test/sbt-buildinfo/constantvalue/build.sbt +++ b/src/sbt-test/sbt-buildinfo/constantvalue/build.sbt @@ -85,8 +85,8 @@ lazy val root = (project in file(".")). """ )""" :: """ }""" :: """}""" :: - """// $COVERAGE-ON$""" :: Nil if (targetInfo contains "target: java.io.File = new java.io.File(") && - (scalaVersionInfo.trim == s"""final val scalaVersion = "$sv"""") => () + """// $COVERAGE-ON$""" :: Nil if targetInfo.contains("target = new java.io.File(") && + (scalaVersionInfo.trim == s"""final val scalaVersion = "$sv"""") => () case _ => sys.error("unexpected output: \n" + lines.mkString("\n")) } () diff --git a/src/sbt-test/sbt-buildinfo/javasingletonrenderer/build.sbt b/src/sbt-test/sbt-buildinfo/javasingletonrenderer/build.sbt index 1aba457..2f85185 100644 --- a/src/sbt-test/sbt-buildinfo/javasingletonrenderer/build.sbt +++ b/src/sbt-test/sbt-buildinfo/javasingletonrenderer/build.sbt @@ -151,7 +151,8 @@ lazy val root = (project in file(".")) """""" :: """ public final String toJson = toJsonValue(toMap());""" :: """}""" :: - """// $COVERAGE-ON$""" :: Nil if ((targetInfo contains "public final java.io.File target = new java.io.File(") && (targetInfoComment contains "/** The value is new java.io.File(")) => + """// $COVERAGE-ON$""" :: Nil if (targetInfo.contains("target = new java.io.File(") && + targetInfoComment.contains("/** The value is new java.io.File(") => () case _ => sys.error("unexpected output: \n" + lines.mkString("\n")) } () diff --git a/src/sbt-test/sbt-buildinfo/javastaticfieldsrenderer/build.sbt b/src/sbt-test/sbt-buildinfo/javastaticfieldsrenderer/build.sbt index ebb9288..c8bd32d 100644 --- a/src/sbt-test/sbt-buildinfo/javastaticfieldsrenderer/build.sbt +++ b/src/sbt-test/sbt-buildinfo/javastaticfieldsrenderer/build.sbt @@ -149,7 +149,8 @@ lazy val root = (project in file(".")) """""" :: """ public static final String makeJson = toJsonValue(makeMap());""" :: """}""" :: - """// $COVERAGE-ON$""" :: Nil if ((targetInfo contains "public static final java.io.File target = new java.io.File(") && (targetInfoComment contains "/** The value is new java.io.File(")) => + """// $COVERAGE-ON$""" :: Nil if targetInfo.contains("target = new java.io.File(") && + targetInfoComment.contains("/** The value is new java.io.File(") => () case _ => sys.error("unexpected output: \n" + lines.mkString("\n")) } () diff --git a/src/sbt-test/sbt-buildinfo/simple/build.sbt b/src/sbt-test/sbt-buildinfo/simple/build.sbt index d5d194b..9a0d229 100644 --- a/src/sbt-test/sbt-buildinfo/simple/build.sbt +++ b/src/sbt-test/sbt-buildinfo/simple/build.sbt @@ -83,10 +83,10 @@ lazy val root = (project in file(".")) """ )""" :: """ }""" :: """}""" :: - """// $COVERAGE-ON$""" :: Nil if (targetInfo contains "val target: java.io.File = new java.io.File(") && - (scalaVersionInfo.trim == s"""val scalaVersion: String = "$sv"""") && - (someCpInfo.contains("/tmp/f.txt")) && - (projectVer.contains("val projectVersion")) => () + """// $COVERAGE-ON$""" :: Nil if targetInfo.contains("target = new java.io.File(") && + (scalaVersionInfo.trim == s"""val scalaVersion: String = "$sv"""") && + (someCpInfo.contains("/tmp/f.txt")) && + (projectVer.contains("val projectVersion")) => () case _ => sys.error("unexpected output: \n" + lines.mkString("\n")) } () diff --git a/src/sbt-test/sbt-buildinfo/skipimportscaseclass/build.sbt b/src/sbt-test/sbt-buildinfo/skipimportscaseclass/build.sbt index 4d110d9..960f92f 100644 --- a/src/sbt-test/sbt-buildinfo/skipimportscaseclass/build.sbt +++ b/src/sbt-test/sbt-buildinfo/skipimportscaseclass/build.sbt @@ -106,7 +106,7 @@ lazy val root = (project in file(".")) """ val get = apply()""" :: """ val value = apply()""" :: """}""" :: - """// $COVERAGE-ON$""" :: Nil if (targetInfo contains "target = new java.io.File(") => + """// $COVERAGE-ON$""" :: Nil if targetInfo.contains("target = new java.io.File(") => () case _ => sys.error("unexpected output: \n" + lines.mkString("\n")) } () diff --git a/src/sbt-test/sbt-buildinfo/usepackageaspath/build.sbt b/src/sbt-test/sbt-buildinfo/usepackageaspath/build.sbt index 266fb2e..a902e63 100644 --- a/src/sbt-test/sbt-buildinfo/usepackageaspath/build.sbt +++ b/src/sbt-test/sbt-buildinfo/usepackageaspath/build.sbt @@ -69,7 +69,7 @@ lazy val root = (project in file(".")) """ )""" :: """ }""" :: """}""" :: - """// $COVERAGE-ON$""" :: Nil if (targetInfo contains "val target: java.io.File = new java.io.File(") => + """// $COVERAGE-ON$""" :: Nil if targetInfo.contains("target = new java.io.File(") => () case _ => sys.error("unexpected output: \n" + lines.mkString("\n")) } ()