Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
Added a test for object key serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
netvl committed Jun 11, 2015
1 parent b0810ab commit 0cc9fa9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 7 additions & 1 deletion project/tests/Pickler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}"""'

0 comments on commit 0cc9fa9

Please sign in to comment.