summaryrefslogtreecommitdiff
path: root/test/scalacheck/Unrolled.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/scalacheck/Unrolled.scala')
-rw-r--r--test/scalacheck/Unrolled.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/scalacheck/Unrolled.scala b/test/scalacheck/Unrolled.scala
new file mode 100644
index 0000000000..ad6e9d3cc8
--- /dev/null
+++ b/test/scalacheck/Unrolled.scala
@@ -0,0 +1,26 @@
+import org.scalacheck._
+import Prop._
+import Gen._
+
+import collection.mutable.UnrolledBuffer
+
+object UnrolledTest extends Properties("UnrolledBuffer") {
+
+ property("concat size") = forAll { (l1: List[Int], l2: List[Int]) =>
+ val u1 = new UnrolledBuffer[Int]
+ u1 ++= l1
+ val u2 = new UnrolledBuffer[Int]
+ u2 ++= l2
+ val totalsz = u1.size + u2.size
+ u1 concat u2
+ totalsz == u1.size
+ }
+
+ property("adding") = forAll { (l: List[Int]) =>
+ val u = new UnrolledBuffer[Int]
+ u ++= l
+ u == l
+ }
+
+}
+