summaryrefslogtreecommitdiff
path: root/test/files/jvm
diff options
context:
space:
mode:
authorJosh Suereth <Joshua.Suereth@gmail.com>2012-09-18 09:57:03 -0700
committerJosh Suereth <Joshua.Suereth@gmail.com>2012-09-18 09:57:03 -0700
commitc9b2ef64108d75ab41ff95cc32bc503e77653e66 (patch)
tree8c20c020da84210aa3fdb09c7ab97bc6d2d4c6a4 /test/files/jvm
parenta9f95dc29f366d935604f15a4a99cbfd1a1bd275 (diff)
parentdbd641f592310d7243f675e27ecc8b9d47684309 (diff)
downloadscala-c9b2ef64108d75ab41ff95cc32bc503e77653e66.tar.gz
scala-c9b2ef64108d75ab41ff95cc32bc503e77653e66.tar.bz2
scala-c9b2ef64108d75ab41ff95cc32bc503e77653e66.zip
Merge pull request #1298 from pavelpavlov/SI-5767
SI-5767 fix + protecting public FlatHashMap API
Diffstat (limited to 'test/files/jvm')
-rw-r--r--test/files/jvm/serialization-new.check24
-rw-r--r--test/files/jvm/serialization-new.scala24
-rw-r--r--test/files/jvm/serialization.check24
-rw-r--r--test/files/jvm/serialization.scala24
4 files changed, 92 insertions, 4 deletions
diff --git a/test/files/jvm/serialization-new.check b/test/files/jvm/serialization-new.check
index fa51c6a879..f886cfe29c 100644
--- a/test/files/jvm/serialization-new.check
+++ b/test/files/jvm/serialization-new.check
@@ -168,6 +168,30 @@ x = History()
y = History()
x equals y: true, y equals x: true
+x = Map(Linked -> 1, Hash -> 2, Map -> 3)
+y = Map(Linked -> 1, Hash -> 2, Map -> 3)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+y = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+x equals y: true, y equals x: true
+
+x = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+y = List((Linked,1), (Hash,2), (Map,3))
+x equals y: true, y equals x: true
+
+x = Set(layers, buffers, title)
+y = Set(layers, buffers, title)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer(layers, buffers, title)
+y = ArrayBuffer(layers, buffers, title)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer(layers, buffers, title)
+y = List(layers, buffers, title)
+x equals y: true, y equals x: true
+
x = ListBuffer(white, black)
y = ListBuffer(white, black)
x equals y: true, y equals x: true
diff --git a/test/files/jvm/serialization-new.scala b/test/files/jvm/serialization-new.scala
index 91eb52928f..1522fc8e27 100644
--- a/test/files/jvm/serialization-new.scala
+++ b/test/files/jvm/serialization-new.scala
@@ -285,8 +285,8 @@ object Test3_mutable {
import scala.reflect.ClassTag
import scala.collection.mutable.{
ArrayBuffer, ArrayBuilder, ArraySeq, ArrayStack, BitSet, DoubleLinkedList,
- HashMap, HashSet, History, LinkedList, ListBuffer, Publisher, Queue,
- Stack, StringBuilder, WrappedArray, TreeSet}
+ HashMap, HashSet, History, LinkedHashMap, LinkedHashSet, LinkedList, ListBuffer,
+ Publisher, Queue, Stack, StringBuilder, WrappedArray, TreeSet}
import scala.collection.concurrent.TrieMap
// in alphabetic order
@@ -346,6 +346,26 @@ object Test3_mutable {
val h1 = new History[String, Int]
val _h1: History[String, Int] = read(write(h1))
check(h1, _h1)
+
+ // LinkedHashMap
+ { val lhm1 = new LinkedHashMap[String, Int]
+ val list = List(("Linked", 1), ("Hash", 2), ("Map", 3))
+ lhm1 ++= list.iterator
+ val _lhm1: LinkedHashMap[String, Int] = read(write(lhm1))
+ check(lhm1, _lhm1)
+ check(lhm1.toSeq, _lhm1.toSeq) // check elements order
+ check(lhm1.toSeq, list) // check elements order
+ }
+
+ // LinkedHashSet
+ { val lhs1 = new LinkedHashSet[String]
+ val list = List("layers", "buffers", "title")
+ lhs1 ++= list.iterator
+ val _lhs1: LinkedHashSet[String] = read(write(lhs1))
+ check(lhs1, _lhs1)
+ check(lhs1.toSeq, _lhs1.toSeq) // check elements order
+ check(lhs1.toSeq, list) // check elements order
+ }
/*
// LinkedList
val ll1 = new LinkedList[Int](2, null)
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check
index fa51c6a879..f886cfe29c 100644
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization.check
@@ -168,6 +168,30 @@ x = History()
y = History()
x equals y: true, y equals x: true
+x = Map(Linked -> 1, Hash -> 2, Map -> 3)
+y = Map(Linked -> 1, Hash -> 2, Map -> 3)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+y = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+x equals y: true, y equals x: true
+
+x = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+y = List((Linked,1), (Hash,2), (Map,3))
+x equals y: true, y equals x: true
+
+x = Set(layers, buffers, title)
+y = Set(layers, buffers, title)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer(layers, buffers, title)
+y = ArrayBuffer(layers, buffers, title)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer(layers, buffers, title)
+y = List(layers, buffers, title)
+x equals y: true, y equals x: true
+
x = ListBuffer(white, black)
y = ListBuffer(white, black)
x equals y: true, y equals x: true
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala
index 9c2f2acdbf..34b64938b4 100644
--- a/test/files/jvm/serialization.scala
+++ b/test/files/jvm/serialization.scala
@@ -285,8 +285,8 @@ object Test3_mutable {
import scala.reflect.ClassManifest
import scala.collection.mutable.{
ArrayBuffer, ArrayBuilder, ArraySeq, ArrayStack, BitSet, DoubleLinkedList,
- HashMap, HashSet, History, LinkedList, ListBuffer, Publisher, Queue,
- Stack, StringBuilder, WrappedArray, TreeSet}
+ HashMap, HashSet, History, LinkedHashMap, LinkedHashSet, LinkedList, ListBuffer,
+ Publisher, Queue, Stack, StringBuilder, WrappedArray, TreeSet}
import scala.collection.concurrent.TrieMap
// in alphabetic order
@@ -346,6 +346,26 @@ object Test3_mutable {
val h1 = new History[String, Int]
val _h1: History[String, Int] = read(write(h1))
check(h1, _h1)
+
+ // LinkedHashMap
+ { val lhm1 = new LinkedHashMap[String, Int]
+ val list = List(("Linked", 1), ("Hash", 2), ("Map", 3))
+ lhm1 ++= list.iterator
+ val _lhm1: LinkedHashMap[String, Int] = read(write(lhm1))
+ check(lhm1, _lhm1)
+ check(lhm1.toSeq, _lhm1.toSeq) // check elements order
+ check(lhm1.toSeq, list) // check elements order
+ }
+
+ // LinkedHashSet
+ { val lhs1 = new LinkedHashSet[String]
+ val list = List("layers", "buffers", "title")
+ lhs1 ++= list.iterator
+ val _lhs1: LinkedHashSet[String] = read(write(lhs1))
+ check(lhs1, _lhs1)
+ check(lhs1.toSeq, _lhs1.toSeq) // check elements order
+ check(lhs1.toSeq, list) // check elements order
+ }
/*
// LinkedList
val ll1 = new LinkedList[Int](2, null)