Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #410 from jvican/double-pickler-generation-travers…
Browse files Browse the repository at this point in the history
…able

Add tests that show #409
  • Loading branch information
jsuereth committed Apr 18, 2016
2 parents 6b0d0fc + 65c79d5 commit c66aaf5
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package scala.pickling.pickler

import org.scalatest.FunSuite
import scala.pickling._, Defaults._, static._, json._

class DoublePicklerUnpicklerGeneration extends FunSuite {

import scala.pickling.internal.currentRuntime

test("generation of pickler should return an already generated pickler") {

// This should get the already generated pickler
// which is already stored in the mapPickler
val pickler = implicitly[Pickler[List[String]]]
val key = pickler.tag.key
val alreadyGenPickler = currentRuntime.picklers.lookupPickler(key)

assert(alreadyGenPickler.get === pickler)

}

test("generation of unpickler should return an already generated unpickler") {

val unpickler = implicitly[Unpickler[List[String]]]
val key = unpickler.tag.key
val alreadyGenUnpickler = currentRuntime.picklers.lookupUnpickler(key)

assert(alreadyGenUnpickler.get === unpickler)

}

}

0 comments on commit c66aaf5

Please sign in to comment.