diff --git a/src/test/scala-2.13/tools/jackson/module/scala/ser/Map2SerializerTest.scala b/src/test/scala-2.13/tools/jackson/module/scala/ser/Map2SerializerTest.scala new file mode 100644 index 000000000..af7acd3bc --- /dev/null +++ b/src/test/scala-2.13/tools/jackson/module/scala/ser/Map2SerializerTest.scala @@ -0,0 +1,21 @@ +package tools.jackson.module.scala.ser + +import tools.jackson.module.scala.{DefaultScalaModule, JacksonModule} + +import scala.collection.immutable.TreeSeqMap +import scala.collection.mutable + +class Map2SerializerTest extends SerializerTest { + + lazy val module: JacksonModule = DefaultScalaModule + + "MapSerializerModule" should "serialize a TreeSeqMap" in { + val result = serialize(TreeSeqMap("a" -> 1, "b" -> "two", "c" -> false)) + result shouldEqual """{"a":1,"b":"two","c":false}""" + } + + it should "serialize a CollisionProofHashMap" in { + val result = serialize(mutable.CollisionProofHashMap("a" -> 1, "b" -> "two", "c" -> false)) + result shouldEqual """{"a":1,"b":"two","c":false}""" + } +} diff --git a/src/test/scala-3/tools/jackson/module/scala/ser/Map2SerializerTest.scala b/src/test/scala-3/tools/jackson/module/scala/ser/Map2SerializerTest.scala new file mode 100644 index 000000000..af7acd3bc --- /dev/null +++ b/src/test/scala-3/tools/jackson/module/scala/ser/Map2SerializerTest.scala @@ -0,0 +1,21 @@ +package tools.jackson.module.scala.ser + +import tools.jackson.module.scala.{DefaultScalaModule, JacksonModule} + +import scala.collection.immutable.TreeSeqMap +import scala.collection.mutable + +class Map2SerializerTest extends SerializerTest { + + lazy val module: JacksonModule = DefaultScalaModule + + "MapSerializerModule" should "serialize a TreeSeqMap" in { + val result = serialize(TreeSeqMap("a" -> 1, "b" -> "two", "c" -> false)) + result shouldEqual """{"a":1,"b":"two","c":false}""" + } + + it should "serialize a CollisionProofHashMap" in { + val result = serialize(mutable.CollisionProofHashMap("a" -> 1, "b" -> "two", "c" -> false)) + result shouldEqual """{"a":1,"b":"two","c":false}""" + } +}