summaryrefslogtreecommitdiff
path: root/test/files/run/t4147.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-03 15:06:02 -0800
committerPaul Phillips <paulp@improving.org>2012-03-03 15:18:23 -0800
commitfb87f2de763e558c8639905ea8dfb447b5212cf7 (patch)
tree155b8fc90c1021ed67d5fe576eafb4a5a745797b /test/files/run/t4147.scala
parent61d34ed3fd61ab60ddea10445c737a3c9a6aa525 (diff)
downloadscala-fb87f2de763e558c8639905ea8dfb447b5212cf7.tar.gz
scala-fb87f2de763e558c8639905ea8dfb447b5212cf7.tar.bz2
scala-fb87f2de763e558c8639905ea8dfb447b5212cf7.zip
Test case closes SI-4777.
And pending tests for most of the other VerifyErrors which still fail to verify.
Diffstat (limited to 'test/files/run/t4147.scala')
-rw-r--r--test/files/run/t4147.scala36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/files/run/t4147.scala b/test/files/run/t4147.scala
new file mode 100644
index 0000000000..c1e2d746a9
--- /dev/null
+++ b/test/files/run/t4147.scala
@@ -0,0 +1,36 @@
+
+
+
+import scala.collection._
+
+
+
+object Test {
+
+ def main(args: Array[String]) {
+ checkElementsAreSorted()
+ checkRangedImpl()
+ }
+
+ def checkElementsAreSorted() {
+ val tree = mutable.SortedSet[Int]()
+ tree ++= List(4, 3, 1, 6, 7, 5, 2)
+ assert(tree == immutable.SortedSet(1, 2, 3, 4, 5, 6, 7))
+ assert(tree.size == 7)
+ }
+
+ def checkRangedImpl() {
+ val tree = mutable.SortedSet[Int](3, 1, 6, 7, 5, 2)
+ val projection = tree.rangeImpl(Some(3), Some(6))
+ assert(projection == immutable.SortedSet(3, 5))
+ assert(projection.size == 2)
+
+ // Let's check that modification are taken into account
+ tree add 4
+ assert(tree == immutable.SortedSet(1, 2, 3, 4, 5, 6, 7))
+ assert(projection == immutable.SortedSet(3, 4, 5))
+ assert(tree.size == 7)
+ assert(projection.size == 3)
+ }
+
+}