summaryrefslogtreecommitdiff
path: root/test/files/scalacheck
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-02-03 17:34:31 +0000
committerPaul Phillips <paulp@improving.org>2010-02-03 17:34:31 +0000
commit96a42a2eda85489bb7dba25d9e8597bd35d7bcbd (patch)
tree51e3848b5d994cdaee75c9faefead41bc9e729d0 /test/files/scalacheck
parenta6eecfb04532c83a715d520e885250e8de808f9e (diff)
downloadscala-96a42a2eda85489bb7dba25d9e8597bd35d7bcbd.tar.gz
scala-96a42a2eda85489bb7dba25d9e8597bd35d7bcbd.tar.bz2
scala-96a42a2eda85489bb7dba25d9e8597bd35d7bcbd.zip
Striking while the iron is hot, renamed removeD...
Striking while the iron is hot, renamed removeDuplicates to unique and deprecated removeDuplicates. The debate between distinct and unique was vigorous but unique won by a freckle. (Dark horse 'nub' was disqualified for taking performance enhancers.) The only thing which might need review is the choice of name, but review by odersky.
Diffstat (limited to 'test/files/scalacheck')
-rw-r--r--test/files/scalacheck/list.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/files/scalacheck/list.scala b/test/files/scalacheck/list.scala
index 87ecd70a48..f08b0d0394 100644
--- a/test/files/scalacheck/list.scala
+++ b/test/files/scalacheck/list.scala
@@ -7,14 +7,14 @@ object Test extends Properties("List") {
property("concat size") = forAll { (l1: List[Int], l2: List[Int]) => (l1.size + l2.size) == (l1 ::: l2).size }
property("reverse") = forAll { (l1: List[Int]) => l1.reverse.reverse == l1 }
- property("toSet") = forAll { (l1: List[Int]) => sorted(l1.toSet.toList) sameElements sorted(l1).removeDuplicates }
+ property("toSet") = forAll { (l1: List[Int]) => sorted(l1.toSet.toList) sameElements sorted(l1).unique }
property("flatten") = forAll { (xxs: List[List[Int]]) => xxs.flatten.length == (xxs map (_.length) sum) }
property("startsWith/take") = forAll { (xs: List[Int], count: Int) => xs startsWith (xs take count) }
property("endsWith/takeRight") = forAll { (xs: List[Int], count: Int) => xs endsWith (xs takeRight count) }
property("fill") = forAll(choose(1, 100)) { count =>
forAll { (x: Int) =>
val xs = List.fill(count)(x)
- (xs.length == count) && (xs.removeDuplicates == List(x))
+ (xs.length == count) && (xs.unique == List(x))
}
}
}