Skip to content

Commit a72dfe9

Browse files
committed
Added scala.collection.convert.WrapperProperties
1 parent 9fcbb85 commit a72dfe9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)