We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9fcbb85 commit a72dfe9Copy full SHA for a72dfe9
test/scalacheck/scala/collection/convert/WrapperProperties.scala
@@ -0,0 +1,24 @@
1
+
2
+package scala.collection.convert
3
4
+import org.scalacheck.{Properties, Test}
5
+import org.scalacheck.Prop._
6
7
+import scala.collection.immutable
8
9
10
+object WrapperProperties extends Properties("Wrappers") {
11
12
+ override def overrideParameters(p: Test.Parameters): Test.Parameters = p.withInitialSeed(42L)
13
14
+ property("JSetWrapper#filterInPlace(p)") = forAll { (hs: immutable.HashSet[Int], p: Int => Boolean) =>
15
+ val expected: collection.Set[Int] = hs.filter(p)
16
+ val actual: collection.Set[Int] = {
17
+ val jset = new java.util.HashSet[Int]()
18
+ hs.foreach(jset.add)
19
+ Wrappers.JSetWrapper(jset)
20
+ }.filterInPlace(p)
21
+ actual ?= expected
22
+ }
23
24
+}
0 commit comments