Skip to content

Commit c6e5b05

Browse files
committed
SerializedExamplesOfStandardDataSpec added more examples
1 parent 2a40471 commit c6e5b05

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

chill-scala/src/test/scala/com/twitter/chill/SerializedExamplesOfStandardDataSpec.scala

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.twitter.chill
22

33
import scala.collection.JavaConverters
4+
import scala.collection.immutable.NumericRange
45

56
import org.scalatest.{ Matchers, WordSpec }
67

@@ -53,15 +54,17 @@ class SerializedExamplesOfStandardDataSpec extends WordSpec with Matchers {
5354
}
5455
}
5556

56-
// In Scala 2.10, instances of the following classes have a serialized representation that differs from
57-
// newer Scala versions: Wrappers$IteratorWrapper
57+
// In older Scala versions, instances of the following classes have a serialized representation that differs from
58+
// the current Scala version 2.12.4:
59+
// 11 -> scala.collection.convert.Wrappers.IteratorWrapper
60+
// 29 -> scala.collection.immutable.Range$Inclusive
5861
val omitExamplesInScalaVersion: Map[String, Seq[Int]] = Map(
59-
"2.10." -> Seq(11))
62+
"2.10." -> Seq(11, 29),
63+
"2.11." -> Seq(29))
6064

6165
val specialCasesNotInExamplesMap: Seq[Int] = Seq(
6266
9 // no way to write an example for 9 -> void
63-
// FIXME for the first discussion, let's just assume that all other examples are already implemented
64-
) ++ Seq.range(19, 143).filterNot(_ == 114)
67+
) // TODO remove once no more needed ++ Seq.range(19, 143).filterNot(_ == 114)
6568

6669
val examples = Seq(
6770
0 -> ("AgI=" -> Int.box(1)),
@@ -91,6 +94,24 @@ class SerializedExamplesOfStandardDataSpec extends WordSpec with Matchers {
9194
16 -> ("EgECBA==" -> Left(2)),
9295
17 -> ("EwECBA==" -> Right(2)),
9396
18 -> ("FAEBAgQ=" -> Vector(2)),
97+
19 -> ("FQEBAgQ=" -> Set(2)),
98+
20 -> ("FgECAgQCBg==" -> Set(2, 3)),
99+
21 -> ("FwEDAgQCBgII" -> Set(2, 3, 4)),
100+
22 -> ("GAEEAgQCBgIIAgo=" -> Set(2, 3, 4, 5)),
101+
// 23 -> TODO find a way to instantiate HashSet$HashTrieSet
102+
24 -> ("GgEBJwECBAIG" -> Map(2 -> 3)),
103+
25 -> ("GwECJwECBAIGJwECCAIK" -> Map(2 -> 3, 4 -> 5)),
104+
26 -> ("HAEDJwECBAIGJwECCAIKJwECDAIO" -> Map(2 -> 3, 4 -> 5, 6 -> 7)),
105+
27 -> ("HQEEJwECBAIGJwECCAIKJwECDAIOJwECEAIS" -> Map(2 -> 3, 4 -> 5, 6 -> 7, 8 -> 9)),
106+
// 28 -> TODO find a way to instantiate HashMap$HashTrieMap
107+
29 -> ("HwEMAAwIBgI=" -> new Range.Inclusive(3, 6, 1)),
108+
30 -> ("IAEBAgoAAQABAHNjYWxhLm1hdGguTnVtZXJpYyRJbnRJc0ludGVncmFspAEBAAMIAgQCAg==" ->
109+
new NumericRange.Inclusive[Int](2, 5, 1)),
110+
31 -> ("IQEBAgoAAAABAHNjYWxhLm1hdGguTnVtZXJpYyRJbnRJc0ludGVncmFspAEBAAMGAgQCAg==" ->
111+
new NumericRange.Exclusive[Int](2, 5, 1)),
112+
32 -> ("IgECAgYCCg==" -> scala.collection.mutable.BitSet(3, 5)),
113+
33 -> ("IwEBJwECBgIK" -> scala.collection.mutable.HashMap(3 -> 5)),
114+
34 -> ("JAEBAgY=" -> scala.collection.mutable.HashSet(3)),
94115
114 -> ("dAE=" -> None))
95116

96117
val kryo: KryoBase = {

0 commit comments

Comments
 (0)