From 0cc9fa90c0ac8e556d9853e55861c8abcd65482a Mon Sep 17 00:00:00 2001 From: Vladimir Matveev Date: Thu, 11 Jun 2015 13:16:44 +0300 Subject: [PATCH] Added a test for object key serialization --- .../io/github/netvl/picopickle/ConvertersTestBase.scala | 2 +- project/tests/Pickler.yml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/test/scala/io/github/netvl/picopickle/ConvertersTestBase.scala b/core/src/test/scala/io/github/netvl/picopickle/ConvertersTestBase.scala index 5a234ce..d8dc195 100644 --- a/core/src/test/scala/io/github/netvl/picopickle/ConvertersTestBase.scala +++ b/core/src/test/scala/io/github/netvl/picopickle/ConvertersTestBase.scala @@ -24,7 +24,7 @@ trait ConvertersTestBase extends FreeSpec with ShouldMatchers with DefaultPickle def backendName: String = "backend" "Converters" - { - s"should convert to and from $backendName representation" - { + s"should convert to and from the $backendName representation" - { "null" in { `null`.isDefinedAt(makeNull) shouldBe true (`null`.fromBackend(makeNull): Any) shouldEqual (null: Any) diff --git a/project/tests/Pickler.yml b/project/tests/Pickler.yml index 723d4ce..7bc8964 100644 --- a/project/tests/Pickler.yml +++ b/project/tests/Pickler.yml @@ -264,4 +264,10 @@ cases: - - 'A(1, "2", 3.4)' - 'Map("x" -> 1, "y" -> "2", "z" -> 3.4)' - '"""{"x":1,"y":"2","z":3.4}"""' - + - name: maps with non-string keys but with a defined object key serializer + prepend: | + implicit val intObjectKeyRW = ObjectKeyReadWriter(_.toInt) + rw: + - - 'Map(1 -> "a", 2 -> "b")' + - 'Map("1" -> "a", "2" -> "b")' + - '"""{"1":"a","2":"b"}"""'