diff options
author | Martin Odersky <odersky@gmail.com> | 2010-05-10 15:40:08 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2010-05-10 15:40:08 +0000 |
commit | 0319fec702a7da3538eee9398faea33721df5311 (patch) | |
tree | 4550b8d434dac02b3051b62a34114fbdcaf351a7 /test/pending/scalacheck/list.scala | |
parent | f8b4ca8cf0b3957e09a21a1019152ae3d87c8a01 (diff) | |
download | scala-0319fec702a7da3538eee9398faea33721df5311.tar.gz scala-0319fec702a7da3538eee9398faea33721df5311.tar.bz2 scala-0319fec702a7da3538eee9398faea33721df5311.zip |
Disabled scalacheck tests because they interfer...
Disabled scalacheck tests because they interfere with library
refactorings (refactorings break scalacheck).
Diffstat (limited to 'test/pending/scalacheck/list.scala')
-rw-r--r-- | test/pending/scalacheck/list.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/pending/scalacheck/list.scala b/test/pending/scalacheck/list.scala new file mode 100644 index 0000000000..1caf35e872 --- /dev/null +++ b/test/pending/scalacheck/list.scala @@ -0,0 +1,21 @@ +import org.scalacheck._ +import Prop._ +import Gen._ + +object Test extends Properties("List") { + def sorted(xs: List[Int]) = xs sortWith (_ < _) + + 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).distinct } + 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.distinct == List(x)) + } + } +} + |