diff options
author | michelou <michelou@epfl.ch> | 2008-02-15 14:49:53 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2008-02-15 14:49:53 +0000 |
commit | 787b0264db2b8f197d1688318a2790fcd037d9c8 (patch) | |
tree | d6fd618516d78fd308ccbfbe13256de30bdd8f0c /test/files/run/t0485.scala | |
parent | 25fd82c6dd3014aa7993d069e8b53ad387d378c5 (diff) | |
download | scala-787b0264db2b8f197d1688318a2790fcd037d9c8.tar.gz scala-787b0264db2b8f197d1688318a2790fcd037d9c8.tar.bz2 scala-787b0264db2b8f197d1688318a2790fcd037d9c8.zip |
fixed #485 (IdentityHashMap)
Diffstat (limited to 'test/files/run/t0485.scala')
-rw-r--r-- | test/files/run/t0485.scala | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/files/run/t0485.scala b/test/files/run/t0485.scala index 8d00936ecb..def5a504df 100644 --- a/test/files/run/t0485.scala +++ b/test/files/run/t0485.scala @@ -21,11 +21,28 @@ object testMap { println(e); println() } } + def test1(m1: Map[Int, Int]) { + try { + m1.put(10, 20) + val m2 = m1.clone() + m1.put(20, 30) + println("m1.size > m2.size is "+ (m1.size > m2.size)) + println() + } + catch { + case e: Exception => + println(e); println() + } + } test(new HashMap[Int, Int]) - test(new IdentityHashMap[Int, Int]) test(new LinkedHashMap[Int, Int]) + // NB. class IdentityHashMap makes no guarantees as to the order + // of the map; in particular, it does not guarantee that the order + // will remain constant over time (see Java API docs). + //test1(new IdentityHashMap[Int, Int]) test(new TreeMap[Int, Int]) test(new WeakHashMap[Int, Int]) + test1(new IdentityHashMap[Int, Int]) } object testSet { |