summaryrefslogtreecommitdiff
path: root/test/files/run/t0485.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2008-02-15 11:30:27 +0000
committermichelou <michelou@epfl.ch>2008-02-15 11:30:27 +0000
commitfa3861528dab4b304b4f74e507af5f40a59705e4 (patch)
tree6e30bedcbc412c7adc25037a43332a1002837ffe /test/files/run/t0485.scala
parent1aad4cb6517f4c63968d11c29f8dfebd8232a49c (diff)
downloadscala-fa3861528dab4b304b4f74e507af5f40a59705e4.tar.gz
scala-fa3861528dab4b304b4f74e507af5f40a59705e4.tar.bz2
scala-fa3861528dab4b304b4f74e507af5f40a59705e4.zip
fixed #485
Diffstat (limited to 'test/files/run/t0485.scala')
-rw-r--r--test/files/run/t0485.scala44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/files/run/t0485.scala b/test/files/run/t0485.scala
new file mode 100644
index 0000000000..8d00936ecb
--- /dev/null
+++ b/test/files/run/t0485.scala
@@ -0,0 +1,44 @@
+import scala.collection.jcl._
+
+object Test extends Application {
+ testMap
+ testSet
+}
+
+object testMap {
+ def test(m1: Map[Int, Int]) {
+ try {
+ m1.put(10, 20)
+ val m2 = m1.clone()
+ m1.put(20, 30)
+ println("m1="+m1)
+ println("m2="+m2)
+ println("m1 == m2 is "+ (m1 == m2))
+ println()
+ }
+ catch {
+ case e: Exception =>
+ println(e); println()
+ }
+ }
+ test(new HashMap[Int, Int])
+ test(new IdentityHashMap[Int, Int])
+ test(new LinkedHashMap[Int, Int])
+ test(new TreeMap[Int, Int])
+ test(new WeakHashMap[Int, Int])
+}
+
+object testSet {
+ def test(m1: Set[Int]) {
+ m1.add(10)
+ val m2 = m1.clone()
+ m1.add(20)
+ println("m1="+m1)
+ println("m2="+m2)
+ println("m1 == m2 is "+ (m1 == m2))
+ println()
+ }
+ test(new HashSet[Int])
+ test(new LinkedHashSet[Int])
+ test(new TreeSet[Int])
+}