summaryrefslogtreecommitdiff
path: root/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-10-20 20:20:08 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-10-20 20:20:08 +0000
commitb689b912caa0e1bcd981c1a0092857ac83fb1e1d (patch)
tree194b115ae192b472baf904de14f7c61bce6af915 /test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
parentb1d9354a08107afab9c15d2ae1b8dded82b5ffef (diff)
downloadscala-b689b912caa0e1bcd981c1a0092857ac83fb1e1d.tar.gz
scala-b689b912caa0e1bcd981c1a0092857ac83fb1e1d.tar.bz2
scala-b689b912caa0e1bcd981c1a0092857ac83fb1e1d.zip
Some serious hash tries bugs fixed.
Plus one wild goose chase and test fixes. No review.
Diffstat (limited to 'test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala')
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala b/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
new file mode 100644
index 0000000000..6b30f61b57
--- /dev/null
+++ b/test/files/scalacheck/parallel-collections/ParallelMapCheck1.scala
@@ -0,0 +1,67 @@
+package scala.collection.parallel
+
+
+
+import org.scalacheck._
+import org.scalacheck.Gen
+import org.scalacheck.Gen._
+import org.scalacheck.Prop._
+import org.scalacheck.Properties
+
+import scala.collection._
+import scala.collection.parallel._
+
+
+
+
+abstract class ParallelMapCheck[K, V](collname: String) extends ParallelIterableCheck[(K, V)](collname) {
+ type CollType <: ParMap[K, V] with Sequentializable[(K, V), Map[K, V]]
+
+ property("gets iterated keys") = forAll(collectionPairs) {
+ case (t, coll) =>
+ val containsT = for ((k, v) <- t) yield (coll.get(k) == Some(v))
+ val containsSelf = for ((k, v) <- coll) yield (coll.get(k) == Some(v))
+ ("Par contains elements of seq map" |: containsT.forall(_ == true)) &&
+ ("Par contains elements of itself" |: containsSelf.forall(_ == true))
+ }
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+