From 35208457e450292f9d0e46b9dc2bfc282db2919a Mon Sep 17 00:00:00 2001 From: Travis Brown Date: Thu, 23 Jan 2020 15:24:59 -0600 Subject: [PATCH 1/4] Changes for Dotty compatibility --- project/GenResources.scala | 6 +- project/GenScalaCheckGen.scala | 120 +++++++++--------- .../scalacheck/CheckerAsserting.scala | 8 +- .../org/scalatest/check/CheckersSpec.scala | 2 +- .../check/ScalaCheckGeneratorsSpec.scala | 2 +- 5 files changed, 69 insertions(+), 69 deletions(-) diff --git a/project/GenResources.scala b/project/GenResources.scala index 1ac7037..cbfdf24 100644 --- a/project/GenResources.scala +++ b/project/GenResources.scala @@ -140,7 +140,7 @@ object GenResourcesJVM extends GenResources { | |def bigProblems(ex: Throwable): String = { | val message = if (ex.getMessage == null) "" else ex.getMessage.trim - | if (message.length > 0) Resources.bigProblemsWithMessage(message) else Resources.bigProblems + | if (message.length > 0) Resources.bigProblemsWithMessage(message) else Resources.bigProblems() |} |} """.stripMargin @@ -188,7 +188,7 @@ object GenResourcesJSVM extends GenResources { | |def bigProblems(ex: Throwable): String = { | val message = if (ex.getMessage == null) "" else ex.getMessage.trim - | if (message.length > 0) Resources.bigProblemsWithMessage(message) else Resources.bigProblems + | if (message.length > 0) Resources.bigProblemsWithMessage(message) else Resources.bigProblems() |} |} """.stripMargin @@ -230,4 +230,4 @@ object GenResourcesJSVM extends GenResources { "}" //"def " + kv.key + "(" + (for (i <- 0 until paramCount) yield s"param$i: Any").mkString(", ") + "): String = Resources." + kv.key + "(" + (for (i <- 0 until paramCount) yield s"decorateToStringValue(param$i)").mkString(", ") + ")" -} \ No newline at end of file +} diff --git a/project/GenScalaCheckGen.scala b/project/GenScalaCheckGen.scala index 44892f8..b5c0a2a 100644 --- a/project/GenScalaCheckGen.scala +++ b/project/GenScalaCheckGen.scala @@ -47,7 +47,7 @@ import org.scalacheck.Arbitrary import org.scalacheck.Shrink import org.scalacheck.Prop import org.scalacheck.Gen -import org.scalacheck.Prop._ +import org.scalacheck.Prop.{BooleanOperators => _, _} import org.scalatest.exceptions.DiscardedEvaluationException import org.scalatest.prop.Whenever import org.scalactic._ @@ -642,16 +642,16 @@ trait ScalaCheckDrivenPropertyChecks extends Whenever with org.scalatestplus.sca case e: DiscardedEvaluationException => (true, false, None) case e: Throwable => (false, false, Some(e)) } - !unmetCondition ==> ( - if (exception.isEmpty) { - if (succeeded) - Prop.passed - else - Prop.falsified - } + !unmetCondition ==> ( + if (exception.isEmpty) { + if (succeeded) + Prop.passed else - Prop.exception(exception.get) - ) + Prop.falsified + } + else + Prop.exception(exception.get) + ) } val prop = Prop.forAll(propF) val params = getScalaCheckParams(configParams, config) @@ -695,16 +695,16 @@ trait ScalaCheckDrivenPropertyChecks extends Whenever with org.scalatestplus.sca case e: DiscardedEvaluationException => (true, false, None) case e: Throwable => (false, false, Some(e)) } - !unmetCondition ==> ( - if (exception.isEmpty) { - if (succeeded) - Prop.passed - else - Prop.falsified - } + !unmetCondition ==> ( + if (exception.isEmpty) { + if (succeeded) + Prop.passed else - Prop.exception(exception.get) - ) + Prop.falsified + } + else + Prop.exception(exception.get) + ) } val prop = Prop.forAll(propF) val params = getScalaCheckParams(configParams, config) @@ -1347,7 +1347,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ args, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 forAll { ($namesAndTypes$) => @@ -1359,7 +1359,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ args, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -1373,7 +1373,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ named args, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 forAll ($argNames$) { ($namesAndTypes$) => @@ -1385,7 +1385,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ named args, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -1399,7 +1399,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ args and generators, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 forAll ($famousArgs$) { ($namesAndTypes$) => @@ -1411,7 +1411,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ args and generators, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -1425,7 +1425,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ named args and generators, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 forAll ($nameGenTuples$) { ($namesAndTypes$) => @@ -1437,7 +1437,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ named args and generators, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -1460,7 +1460,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ args, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -1482,7 +1482,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ named args, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -1504,7 +1504,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ args and generators, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -1526,7 +1526,7 @@ import org.scalacheck.Gen it("generator-driven property that takes $n$ named args and generators, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -1718,7 +1718,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args and generators, with sizeRange == 0, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 5) forAll ($fiveFiveArgs$, sizeRange(0)) { ($namesAndTypes$) => $okayAssertions$ @@ -1728,7 +1728,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args and generators, with sizeRange == 0, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 5) forAll ($fiveFiveNameGenTuples$, sizeRange(0)) { ($namesAndTypes$) => $okayAssertions$ @@ -1796,7 +1796,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args and generators, with minSize to 7 and sizeRange to 4, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 7) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 7) forAll ($sevenElevenArgs$, sizeRange(4)) { ($namesAndTypes$) => $okayAssertions$ @@ -1806,7 +1806,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args and generators, with minSize to 7 and sizeRange to 4, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 7) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 7) forAll ($sevenElevenNameGenTuples$, sizeRange(4)) { ($namesAndTypes$) => $okayAssertions$ @@ -2051,7 +2051,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 val result = @@ -2064,7 +2064,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 val result = forAll { ($namesAndTypes$) => @@ -2077,7 +2077,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 val result = @@ -2091,7 +2091,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) val result = { var i = 0 @@ -2106,7 +2106,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args and generators, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 val result = @@ -2120,7 +2120,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args and generators, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) val result = { var i = 0 @@ -2135,7 +2135,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args and generators, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 val result = @@ -2149,7 +2149,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args and generators, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) val result = { var i = 0 @@ -2175,7 +2175,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) val result = { var i = 0 @@ -2200,7 +2200,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) val result = { var i = 0 @@ -2225,7 +2225,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args and generators, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) val result = { var i = 0 @@ -2250,7 +2250,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args and generators, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) val result = { var i = 0 @@ -2469,7 +2469,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args and generators, with sizeRange == 0, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 5) val result = forAll ($fiveFiveArgs$, sizeRange(0)) { ($namesAndTypes$) => @@ -2481,7 +2481,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args and generators, with sizeRange == 0, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 5) val result = forAll ($fiveFiveNameGenTuples$, sizeRange(0)) { ($namesAndTypes$) => @@ -2563,7 +2563,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ args and generators, with minSize to 7 and sizeRange to 4, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 7) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 7) val result = forAll ($sevenElevenArgs$, sizeRange(4)) { ($namesAndTypes$) => @@ -2575,7 +2575,7 @@ $okayAssertions$ it("generator-driven property that takes $n$ named args and generators, with minSize to 7 and sizeRange to 4, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 7) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 7) val result = forAll ($sevenElevenNameGenTuples$, sizeRange(4)) { ($namesAndTypes$) => @@ -2742,7 +2742,7 @@ $okayAssertions$ it("ScalaCheck property that takes $n$ args, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 check { ($namesAndTypes$) => @@ -2755,7 +2755,7 @@ $okayAssertions$ it("ScalaCheck property that takes $n$ args, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -2770,7 +2770,7 @@ $okayAssertions$ it("ScalaCheck property that takes $n$ args and generators, which succeeds, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) var i = 0 val prop = forAll ($famousArgs$) { ($namesAndTypes$) => @@ -2784,7 +2784,7 @@ $okayAssertions$ it("ScalaCheck property that takes $n$ args and generators, which fails, with default minSuccessful param set to 5") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -2812,7 +2812,7 @@ $okayAssertions$ it("ScalaCheck property that takes $n$ args, which fails, with maxDiscardedFactor param set to 0.6") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -2838,7 +2838,7 @@ $okayAssertions$ it("ScalaCheck property that takes $n$ args and generators, which fails, with maxDiscardedFactor param set to 1.2") { - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSuccessful = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSuccessful = 5) intercept[GeneratorDrivenPropertyCheckFailedException] { var i = 0 @@ -2952,7 +2952,7 @@ $okayExpressions$ it("ScalaCheck property that takes $n$ args and generators, with sizeRange == 0, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 5) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 5) val prop = forAll ($fiveFiveArgs$) { ($namesAndTypes$) => $okayExpressions$ @@ -2997,7 +2997,7 @@ $okayExpressions$ it("ScalaCheck property that takes $n$ args and generators, with minSize to 7 and sizeRange to 4, specified as (default, param)") { // Hides the member - implicit val generatorDrivenConfig = PropertyCheckConfiguration(minSize = 7) + implicit val generatorDrivenConfig: PropertyCheckConfiguration = PropertyCheckConfiguration(minSize = 7) val prop = forAll ($sevenElevenArgs$) { ($namesAndTypes$) => $okayExpressions$ @@ -3119,7 +3119,7 @@ $okayExpressions$ bw.write(st.toString) bw.write(generatorSuitePreamble) if (doItForCheckers) { - bw.write("import org.scalacheck.Prop.{Exception => _, _}\n") + bw.write("import org.scalacheck.Prop.{BooleanOperators => _, Exception => _, _}\n") } if (!mixinInvitationStyle) bw.write("import org.scalatestplus.scalacheck." + traitOrObjectName + "._\n") diff --git a/scalatestPlusScalaCheck/src/main/scala/org/scalatestplus/scalacheck/CheckerAsserting.scala b/scalatestPlusScalaCheck/src/main/scala/org/scalatestplus/scalacheck/CheckerAsserting.scala index 2afd17a..d9381cb 100644 --- a/scalatestPlusScalaCheck/src/main/scala/org/scalatestplus/scalacheck/CheckerAsserting.scala +++ b/scalatestPlusScalaCheck/src/main/scala/org/scalatestplus/scalacheck/CheckerAsserting.scala @@ -126,7 +126,7 @@ abstract class UnitCheckerAsserting { case _ => "" } ) + - " " + FailureMessages.occurredOnValues + "\n" + + " " + FailureMessages.occurredOnValues() + "\n" + prettyArgs(getArgsWithSpecifiedNames(argNames, scalaCheckArgs), prettifier) + "\n" + " )" + getLabelDisplay(scalaCheckLabels), @@ -149,7 +149,7 @@ abstract class UnitCheckerAsserting { case _ => "" } ) + - " " + FailureMessages.occurredOnValues + "\n" + + " " + FailureMessages.occurredOnValues() + "\n" + prettyArgs(getArgsWithSpecifiedNames(argNames, scalaCheckArgs), prettifier) + "\n" + " )" + getLabelDisplay(scalaCheckLabels), @@ -160,7 +160,7 @@ abstract class UnitCheckerAsserting { pos ) } - } else indicateSuccess(FailureMessages.propertyCheckSucceeded) + } else indicateSuccess(FailureMessages.propertyCheckSucceeded()) } private[scalacheck] def indicateSuccess(message: => String): Result @@ -266,7 +266,7 @@ object CheckerAsserting extends ExpectationCheckerAsserting { private[scalacheck] def getLabelDisplay(labels: Set[String]): String = if (labels.size > 0) - "\n " + (if (labels.size == 1) Resources.propCheckLabel else Resources.propCheckLabels) + "\n" + labels.map(" " + _).mkString("\n") + "\n " + (if (labels.size == 1) Resources.propCheckLabel() else Resources.propCheckLabels()) + "\n" + labels.map(" " + _).mkString("\n") else "" diff --git a/scalatestPlusScalaCheck/src/test/scala/org/scalatest/check/CheckersSpec.scala b/scalatestPlusScalaCheck/src/test/scala/org/scalatest/check/CheckersSpec.scala index 9c55567..81c2fdd 100644 --- a/scalatestPlusScalaCheck/src/test/scala/org/scalatest/check/CheckersSpec.scala +++ b/scalatestPlusScalaCheck/src/test/scala/org/scalatest/check/CheckersSpec.scala @@ -18,7 +18,7 @@ package org.scalatestplus.scalacheck import org.scalacheck._ import org.scalatest._ import Arbitrary._ -import Prop._ +import Prop.{BooleanOperators => _, _} import org.scalatest.matchers.should.Matchers._ import org.scalatest.exceptions.GeneratorDrivenPropertyCheckFailedException import org.scalacheck.util.Pretty diff --git a/scalatestPlusScalaCheck/src/test/scala/org/scalatest/check/ScalaCheckGeneratorsSpec.scala b/scalatestPlusScalaCheck/src/test/scala/org/scalatest/check/ScalaCheckGeneratorsSpec.scala index be4a915..f24effc 100644 --- a/scalatestPlusScalaCheck/src/test/scala/org/scalatest/check/ScalaCheckGeneratorsSpec.scala +++ b/scalatestPlusScalaCheck/src/test/scala/org/scalatest/check/ScalaCheckGeneratorsSpec.scala @@ -18,7 +18,7 @@ import org.scalacheck._ import org.scalatest._ import Arbitrary._ -import Prop._ +import Prop.{BooleanOperators => _, _} import org.scalatest.Matchers._ import org.scalatest.exceptions.GeneratorDrivenPropertyCheckFailedException import org.scalacheck.util.Pretty From 3780ed9134074d38224bcf2333903acae7041e50 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Wed, 17 Jun 2020 10:43:24 +0800 Subject: [PATCH 2/4] Fixed broken scala-js build. --- project/GenResources.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/GenResources.scala b/project/GenResources.scala index cbfdf24..4545c84 100644 --- a/project/GenResources.scala +++ b/project/GenResources.scala @@ -209,7 +209,7 @@ object GenResourcesJSVM extends GenResources { "final val raw" + kv.key.capitalize + " = \"" + kv.value.replaceAllLiterally("\"", "\\\"").replaceAllLiterally("''", "'") + "\"\n\n" + ( if (paramCount == 0 ) - "final val " + kv.key + " = raw" + kv.key.capitalize + "final def " + kv.key + "() = raw" + kv.key.capitalize else "def " + kv.key + "(" + (for (i <- 0 until paramCount) yield s"param$i: Any").mkString(", ") + "): String = \n" + " raw" + kv.key.capitalize + (for (i <- 0 until paramCount) yield ".replaceAllLiterally(\"{" + i + "}\", param" + i + " + \"\")").mkString + "\n" @@ -223,7 +223,7 @@ object GenResourcesJSVM extends GenResources { def failureMessagesKeyValueTemplate(kv: KeyValue, paramCount: Int): String = if (paramCount == 0) - "final val " + kv.key + " = Resources." + kv.key + "final def " + kv.key + "() = Resources." + kv.key else "object " + kv.key + " { \ndef apply(" + (if (paramCount == 0) "" else "prettifier: org.scalactic.Prettifier, ") + (for (i <- 0 until paramCount) yield s"param$i: Any").mkString(", ") + "): String = \n" + " Resources." + kv.key + "(" + (for (i <- 0 until paramCount) yield s"decorateToStringValue(prettifier, param$i)").mkString(", ") + ")" + "\n" + From a995899743dd882a75632972cabbcfe218afd508 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Wed, 17 Jun 2020 10:43:57 +0800 Subject: [PATCH 3/4] Added cross build for dotty 0.24.0. --- build.sbt | 7 ++++--- project/build.properties | 2 +- project/plugins.sbt | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index adc3349..8d83bcc 100644 --- a/build.sbt +++ b/build.sbt @@ -23,10 +23,10 @@ val sharedSettings = Seq( url("https://github.com/cheeseng") ) ), - resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots", + resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots", libraryDependencies ++= Seq( "org.scalatest" %%% "scalatest-core" % "3.2.0", - "org.scalacheck" %%% "scalacheck" % "1.14.3", + ("org.scalacheck" %%% "scalacheck" % "1.14.3").withDottyCompat(scalaVersion.value), "org.scalatest" %%% "scalatest-shouldmatchers" % "3.2.0" % "test", "org.scalatest" %%% "scalatest-funspec" % "3.2.0" % "test", "org.scalatest" %%% "scalatest-funsuite" % "3.2.0" % "test" @@ -98,7 +98,8 @@ lazy val scalatestPlusScalaCheck = } ) .jvmSettings( - crossScalaVersions := List("2.10.7", "2.11.12", "2.12.11", "2.13.2"), + crossScalaVersions := List("2.10.7", "2.11.12", "2.12.11", "2.13.2", "0.24.0"), + Test / scalacOptions ++= (if (isDotty.value) Seq("-language:implicitConversions") else Nil), sourceGenerators in Compile += { Def.task { GenResourcesJVM.genResources((sourceManaged in Compile).value / "org" / "scalatestplus" / "scalacheck", version.value, scalaVersion.value) ++ diff --git a/project/build.properties b/project/build.properties index c0bab04..654fe70 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.8 +sbt.version=1.3.12 diff --git a/project/plugins.sbt b/project/plugins.sbt index 5efa369..cfe9c4b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,7 @@ addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "0.6.0") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "0.6.0") -val scalaJSVersion = Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.0.1") +val scalaJSVersion = Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.1.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) @@ -13,3 +13,5 @@ addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1") addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2") addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.4") + +addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.1") From 9e22001a78edec6433fb128c4dd0ec66fd21b0b9 Mon Sep 17 00:00:00 2001 From: Chua Chee Seng Date: Wed, 17 Jun 2020 12:49:45 +0800 Subject: [PATCH 4/4] Bumped up to use sbt-pgp 2.0.1. --- .gitignore | 1 + README.md | 2 +- build.sbt | 13 ++++++++++--- project/plugins.sbt | 4 +--- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 82f9047..5148839 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.log target .idea/ +_site/ \ No newline at end of file diff --git a/README.md b/README.md index 23a591c..977bdca 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Please use the following commands to publish to Sonatype: ``` $ export SCALAJS_VERSION=0.6.33 $ sbt clean +scalatestPlusScalaCheckJS/publishSigned +scalatestPlusScalaCheckJVM/publishSigned scalatestPlusScalaCheckNative/publishSigned -$ export SCALAJS_VERSION=1.0.1 +$ export SCALAJS_VERSION=1.1.0 $ sbt ++2.11.12 "project scalatestPlusScalaCheckJS" clean publishSigned $ sbt ++2.12.11 "project scalatestPlusScalaCheckJS" clean publishSigned $ sbt ++2.13.2 "project scalatestPlusScalaCheckJS" clean publishSigned diff --git a/build.sbt b/build.sbt index 8d83bcc..59bd9ed 100644 --- a/build.sbt +++ b/build.sbt @@ -60,9 +60,16 @@ val sharedSettings = Seq( publishMavenStyle := true, publishArtifact in Test := false, pomIncludeRepository := { _ => false }, - credentials += Credentials(Path.userHome / ".ivy2" / ".credentials"), - pgpSecretRing := file((Path.userHome / ".gnupg" / "secring.gpg").getAbsolutePath), - pgpPassphrase := None + pomExtra := ( + + https://github.com/scalatest/scalatestplus-scalacheck + scm:git:git@github.com:scalatest/scalatestplus-scalacheck.git + + scm:git:git@github.com:scalatest/scalatestplus-scalacheck.git + + + ), + credentials += Credentials(Path.userHome / ".ivy2" / ".credentials") ) lazy val scalatestPlusScalaCheck = diff --git a/project/plugins.sbt b/project/plugins.sbt index cfe9c4b..14c4d04 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,9 +8,7 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVer addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.0-M2") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1") - -addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1") addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.4")