summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuediger Klaehn <rklaehn@gmail.com>2012-08-25 00:33:04 +0200
committerRuediger Klaehn <rklaehn@gmail.com>2012-08-25 00:33:04 +0200
commit42b53cef77ce41c6a66887c5b25a0a23b82cd085 (patch)
treeebc424fe8f030176eafc7a78092fe93883dfd4c1
parentace7a61e663e8369cc50e527c990ee4c3751cb89 (diff)
downloadscala-42b53cef77ce41c6a66887c5b25a0a23b82cd085.tar.gz
scala-42b53cef77ce41c6a66887c5b25a0a23b82cd085.tar.bz2
scala-42b53cef77ce41c6a66887c5b25a0a23b82cd085.zip
Added test to ensure that ListMap.tail is O(1)
-rw-r--r--test/files/run/t6261.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/files/run/t6261.scala b/test/files/run/t6261.scala
index bf6d640de3..b4463256c9 100644
--- a/test/files/run/t6261.scala
+++ b/test/files/run/t6261.scala
@@ -2,6 +2,12 @@ import scala.collection.immutable._
object Test extends App {
+ def test0() {
+ val m=ListMap(1->2,3->4)
+ if(m.tail ne m.tail)
+ println("ListMap.tail uses a builder, so it is not O(1)")
+ }
+
def test1() {
// test that a HashTrieMap with one leaf element is not created!
val x = HashMap.empty + (1->1) + (2->2)
@@ -86,6 +92,7 @@ object Test extends App {
// StructureTests.printStructure(z)
require(z.size == 2 && z.contains(a._1) && z.contains(c._1))
}
+ test0()
test1()
test2()
test3()