diff options
Diffstat (limited to 'src/test/scala/CoproductTypeFormats.scala')
-rw-r--r-- | src/test/scala/CoproductTypeFormats.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test/scala/CoproductTypeFormats.scala b/src/test/scala/CoproductTypeFormats.scala index f9b71b8..cdf0201 100644 --- a/src/test/scala/CoproductTypeFormats.scala +++ b/src/test/scala/CoproductTypeFormats.scala @@ -27,8 +27,8 @@ class CoproductTypeFormats ) "Nested parameter case class child" should behave like checkCoherence[Expr]( - Plus(Value(42), Value(0)), - """{"type":"Plus","lhs":{"type":"Value","x":42},"rhs":{"type":"Value","x":0}}""" + Plus(Value(42), One), + """{"type":"Plus","lhs":{"type":"Value","x":42},"rhs":"One"}""" ) "Case object child" should behave like checkCoherence[Expr]( @@ -54,4 +54,9 @@ class CoproductTypeFormats """["A", "B"]""" ) + "Serializing as sealed trait an deserializing as child" should "work" in { + val expr: Expr = Plus(Value(42), Plus(Zero(), One)) + assert(expr.toJson.convertTo[Plus] == expr) + } + } |