summaryrefslogtreecommitdiff
path: root/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/scalacheck/parallel-collections/ParallelSetCheck.scala')
-rw-r--r--test/files/scalacheck/parallel-collections/ParallelSetCheck.scala62
1 files changed, 62 insertions, 0 deletions
diff --git a/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala b/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala
new file mode 100644
index 0000000000..092f4823df
--- /dev/null
+++ b/test/files/scalacheck/parallel-collections/ParallelSetCheck.scala
@@ -0,0 +1,62 @@
+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 ParallelSetCheck[T](collname: String) extends ParallelIterableCheck[T](collname) {
+ type CollType <: ParSet[T] with Sequentializable[T, Set[T]]
+
+ property("gets iterated keys") = forAll(collectionPairs) {
+ case (t, coll) =>
+ val containsT = for (elem <- t) yield (coll.contains(elem))
+ val containsSelf = for (elem <- coll) yield (coll.contains(elem))
+ ("Par contains elements of seq map" |: containsT.forall(_ == true)) &&
+ ("Par contains elements of itself" |: containsSelf.forall(_ == true))
+ }
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+