diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-19 16:29:14 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-20 14:44:31 -0800 |
commit | 733f7f086834b549e33a01b5d7504ac2d1353815 (patch) | |
tree | 4f1e747756b33be13544fdd15e707ce7afdb17f8 /test/files | |
parent | c243435f113615b2f7407fbd683c93ec16c73749 (diff) | |
download | scala-733f7f086834b549e33a01b5d7504ac2d1353815.tar.gz scala-733f7f086834b549e33a01b5d7504ac2d1353815.tar.bz2 scala-733f7f086834b549e33a01b5d7504ac2d1353815.zip |
Prepare upgrade to scalacheck 1.11.
Our scalacheck tests now compile against 1.10.1 and 1.11.0.
They pass on 1.10.1, but fail on 1.11.0.
Once (that)[https://github.com/rickynils/scalacheck/issues/79]'s fixed,
and 1.11.1 released, we should be able to upgrade to it by simply
changing scalacheck.version.number in versions.properties.
The changes are mostly removing dead code (e.g., consolereporter business).
Of interest: the type ascription for `oneOf`. I haven't quite investigated,
but something seems to have changed between 1.10.1 and 1.11.0 that caused
a different overload to be picked without the type ascription.
Probably not a scalac bug, just a scalacheck api change.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/scalacheck/CheckCollections.scala | 9 | ||||
-rw-r--r-- | test/files/scalacheck/CheckEither.scala | 12 | ||||
-rw-r--r-- | test/files/scalacheck/array-new.scala | 2 | ||||
-rw-r--r-- | test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala | 6 | ||||
-rw-r--r-- | test/files/scalacheck/si4147.scala | 4 | ||||
-rw-r--r-- | test/files/scalacheck/t2460.scala | 5 | ||||
-rw-r--r-- | test/files/scalacheck/treeset.scala | 2 |
7 files changed, 9 insertions, 31 deletions
diff --git a/test/files/scalacheck/CheckCollections.scala b/test/files/scalacheck/CheckCollections.scala index 108040b900..329d505b47 100644 --- a/test/files/scalacheck/CheckCollections.scala +++ b/test/files/scalacheck/CheckCollections.scala @@ -1,4 +1,4 @@ -import org.scalacheck.{ ConsoleReporter, Properties } +import org.scalacheck.Properties import org.scalacheck.Prop._ import scala.reflect.internal.util.Collections._ @@ -49,11 +49,4 @@ object Test extends Properties("reflect.internal.util.Collections") { for { (label, prop) <- tests } property(label) = prop - - import org.scalacheck.{ Test => STest } - - def runTests() = - STest.checkProperties( - STest.Params(testCallback = ConsoleReporter(0)), this) - } diff --git a/test/files/scalacheck/CheckEither.scala b/test/files/scalacheck/CheckEither.scala index 4d0cab4693..48f732a22d 100644 --- a/test/files/scalacheck/CheckEither.scala +++ b/test/files/scalacheck/CheckEither.scala @@ -1,10 +1,8 @@ -import org.scalacheck.{ Arbitrary, ConsoleReporter, Prop, Properties } +import org.scalacheck.{ Arbitrary, Prop, Properties } import org.scalacheck.Arbitrary.{arbitrary, arbThrowable} import org.scalacheck.Gen.oneOf -import org.scalacheck.util.StdRand import org.scalacheck.Prop._ -import org.scalacheck.Test.{Params, check} -import org.scalacheck.ConsoleReporter.testStatsEx +import org.scalacheck.Test.check import Function.tupled object Test extends Properties("Either") { @@ -178,10 +176,4 @@ object Test extends Properties("Either") { for ((label, prop) <- tests) { property(label) = prop } - - import org.scalacheck.{ Test => STest } - - def runTests() = { - STest.checkProperties(STest.Params(testCallback = ConsoleReporter(0)), this) - } } diff --git a/test/files/scalacheck/array-new.scala b/test/files/scalacheck/array-new.scala index e13a47a5d5..d8c69ead78 100644 --- a/test/files/scalacheck/array-new.scala +++ b/test/files/scalacheck/array-new.scala @@ -1,4 +1,4 @@ -import scala.reflect.{ClassTag, classTag} +import scala.reflect.ClassTag // new style: use ClassTag import org.scalacheck._ import Prop._ import Gen._ diff --git a/test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala b/test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala index c4b93dae48..7905a2ca15 100644 --- a/test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala +++ b/test/files/scalacheck/quasiquotes/ArbitraryTreesAndNames.scala @@ -222,7 +222,7 @@ trait ArbitraryTreesAndNames { yield ValDef(mods, name, tpt, rhs) def genTree(size: Int): Gen[Tree] = - if (size <= 1) oneOf(EmptyTree, genTreeIsTerm(size), genTreeIsType(size)) + if (size <= 1) oneOf(EmptyTree: Gen[Tree], genTreeIsTerm(size), genTreeIsType(size)) else oneOf(genTree(1), // these trees are neither terms nor types genPackageDef(size - 1), genModuleDef(size - 1), @@ -273,8 +273,8 @@ trait ArbitraryTreesAndNames { def apply(universe: Universe, value: TreeIsType): universe.Tree = value.tree.asInstanceOf[universe.Tree] } - implicit def treeIsTerm2tree(tit: TreeIsTerm) = tit.tree - implicit def treeIsType2tree(tit: TreeIsType) = tit.tree + implicit def treeIsTerm2tree(tit: TreeIsTerm): Tree = tit.tree + implicit def treeIsType2tree(tit: TreeIsType): Tree = tit.tree implicit val arbConstant: Arbitrary[Constant] = Arbitrary(genConstant) implicit val arbModifiers: Arbitrary[Modifiers] = Arbitrary(genModifiers) diff --git a/test/files/scalacheck/si4147.scala b/test/files/scalacheck/si4147.scala index 05507b1b18..72f6e9afd5 100644 --- a/test/files/scalacheck/si4147.scala +++ b/test/files/scalacheck/si4147.scala @@ -1,8 +1,6 @@ import org.scalacheck.Prop.{forAll, throws} import org.scalacheck.Properties -import org.scalacheck.ConsoleReporter.testStatsEx import org.scalacheck.Gen -import org.scalacheck.ConsoleReporter import collection.mutable @@ -66,5 +64,5 @@ object Test extends Properties("Mutable TreeSet") { } property("ordering must not be null") = - throws(mutable.TreeSet.empty[Int](null), classOf[NullPointerException]) + throws(classOf[NullPointerException])(mutable.TreeSet.empty[Int](null)) } diff --git a/test/files/scalacheck/t2460.scala b/test/files/scalacheck/t2460.scala index 196b43789f..ab2911447a 100644 --- a/test/files/scalacheck/t2460.scala +++ b/test/files/scalacheck/t2460.scala @@ -1,6 +1,5 @@ import org.scalacheck.Prop.forAll import org.scalacheck.Properties -import org.scalacheck.ConsoleReporter.testStatsEx import org.scalacheck.{Test => SCTest} import org.scalacheck.Gen @@ -25,8 +24,4 @@ object Test extends Properties("Regex : Ticket 2460") { ("numberOfGroup", numberOfGroup), ("nameOfGroup", nameOfGroup) ) - - /*tests foreach { - case (name, p) => testStatsEx(name, SCTest.check(p)) - }*/ } diff --git a/test/files/scalacheck/treeset.scala b/test/files/scalacheck/treeset.scala index 7fca3ed5e4..4b9b77dd7e 100644 --- a/test/files/scalacheck/treeset.scala +++ b/test/files/scalacheck/treeset.scala @@ -151,5 +151,5 @@ object Test extends Properties("TreeSet") { } property("ordering must not be null") = - throws(TreeSet.empty[Int](null), classOf[NullPointerException]) + throws(classOf[NullPointerException])(TreeSet.empty[Int](null)) } |