diff options
author | Paul Phillips <paulp@improving.org> | 2010-02-04 12:26:42 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-02-04 12:26:42 +0000 |
commit | 9ee1f2f3b8ed91897bb298592f8a600ff5e4622d (patch) | |
tree | a2959e3eeaecb558d13a279404d35fb174df7ee7 /test/files/run | |
parent | 93277ea0201f139e829cfd7248142a0c5898d9ce (diff) | |
download | scala-9ee1f2f3b8ed91897bb298592f8a600ff5e4622d.tar.gz scala-9ee1f2f3b8ed91897bb298592f8a600ff5e4622d.tar.bz2 scala-9ee1f2f3b8ed91897bb298592f8a600ff5e4622d.zip |
Unique's seeming victory is overruled by commit...
Unique's seeming victory is overruled by committee. It is "distinct",
not "unique", wherein lies the nub. No review.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/Course-2002-13.scala | 4 | ||||
-rw-r--r-- | test/files/run/colltest1.scala | 4 | ||||
-rw-r--r-- | test/files/run/hashCodeBoxesRunTime.scala | 2 | ||||
-rw-r--r-- | test/files/run/hashCodeDistribution.scala | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/test/files/run/Course-2002-13.scala b/test/files/run/Course-2002-13.scala index fa5390e534..c016d41a90 100644 --- a/test/files/run/Course-2002-13.scala +++ b/test/files/run/Course-2002-13.scala @@ -66,7 +66,7 @@ object Terms { override def toString() = a + (if (ts.isEmpty) "" else ts.mkString("(", ",", ")")); def map(s: Subst): Term = Con(a, ts map (t => t map s)); - def tyvars = (ts flatMap (t => t.tyvars)).unique; + def tyvars = (ts flatMap (t => t.tyvars)).distinct; } private var count = 0; @@ -113,7 +113,7 @@ object Programs { case class Clause(lhs: Term, rhs: List[Term]) { def tyvars = - (lhs.tyvars ::: (rhs flatMap (t => t.tyvars))).unique; + (lhs.tyvars ::: (rhs flatMap (t => t.tyvars))).distinct; def newInstance = { var s: Subst = List(); for (val a <- tyvars) { s = Binding(a, newVar(a)) :: s } diff --git a/test/files/run/colltest1.scala b/test/files/run/colltest1.scala index b07e6b0e59..47b273f8ee 100644 --- a/test/files/run/colltest1.scala +++ b/test/files/run/colltest1.scala @@ -80,7 +80,7 @@ object Test extends Application { val tenPlus = ten map (_ + 1) assert((ten zip tenPlus) forall { case (x, y) => x + 1 == y }) val dble = ten flatMap (x => List(x, x)) - assert(dble.unique == ten) + assert(dble.distinct == ten) assert(ten.length == 10) assert(ten(0) == 1 && ten(9) == 10) assert((ten lengthCompare 10) == 0 && (ten lengthCompare 1) > 0 && (ten lengthCompare 11) < 0) @@ -122,7 +122,7 @@ object Test extends Application { assert((ten diff (ten filter (_ % 2 == 0))) == (ten filterNot (_ % 2 == 0))) assert((ten intersect ten) == ten) assert((ten intersect List(5)) == List(5)) - assert((ten ++ ten).unique == ten) + assert((ten ++ ten).distinct == ten) assert(ten.patch(3, List(4, 5, 6, 7), 4) == ten) assert(ten.patch(0, List(1, 2, 3), 9) == List(1, 2, 3, 10)) assert(empty.padTo(10, 7) == Array.fill(10)(7).toSeq) diff --git a/test/files/run/hashCodeBoxesRunTime.scala b/test/files/run/hashCodeBoxesRunTime.scala index 9ead89beb4..ba1a30f5fb 100644 --- a/test/files/run/hashCodeBoxesRunTime.scala +++ b/test/files/run/hashCodeBoxesRunTime.scala @@ -5,7 +5,7 @@ object Test import java.{ lang => jl } import scala.runtime.BoxesRunTime.{ hashFromNumber, hashFromObject } - def allSame[T](xs: List[T]) = assert(xs.unique.size == 1, "failed: " + xs) + def allSame[T](xs: List[T]) = assert(xs.distinct.size == 1, "failed: " + xs) def mkNumbers(x: Int): List[Number] = List(x.toByte, x.toShort, x, x.toLong, x.toFloat, x.toDouble) diff --git a/test/files/run/hashCodeDistribution.scala b/test/files/run/hashCodeDistribution.scala index 64cae398f1..5be9d1db6d 100644 --- a/test/files/run/hashCodeDistribution.scala +++ b/test/files/run/hashCodeDistribution.scala @@ -8,7 +8,7 @@ object Test { val hashCodes = for (x <- 0 until COUNT; y <- 0 until COUNT) yield C(x,y).hashCode - val uniques = hashCodes.unique + val uniques = hashCodes.distinct val collisionRate = (totalCodes - uniques.size) * 1000 / totalCodes assert(collisionRate < 5, "Collision rate too high: %d / 1000".format(collisionRate)) |