Skip to content
Browse files

Add a test for already fixed bug (commit 9de55fc), fixes #1133

  • Loading branch information...
1 parent 686a8f1 commit 2dbccbb182dfbc555248df3d51a7c1b6517bda58 Joni Freeman committed Oct 20, 2011
Showing with 15 additions and 1 deletion.
  1. +15 −1 core/json/src/test/scala/net/liftweb/json/FieldSerializerBugs.scala
View
16 core/json/src/test/scala/net/liftweb/json/FieldSerializerBugs.scala
@@ -42,6 +42,20 @@ object FieldSerializerBugs extends Specification {
str mustEqual """{"a-b*c":5}"""
read[WithSymbol](str) mustEqual s
}
+
+ "FieldSerialization should work with Options" in {
+ implicit val formats = DefaultFormats + FieldSerializer[ClassWithOption]()
+
+ val t = new ClassWithOption
+ t.field = Some(5)
+ read[ClassWithOption](Serialization.write(t)).field mustEqual Some(5)
+ }
+
+ case class WithSymbol(`a-b*c`: Int)
+
+ class ClassWithOption {
+ var field: Option[Int] = None
+ }
}
-case class WithSymbol(`a-b*c`: Int)
+

0 comments on commit 2dbccbb

Please sign in to comment.
Something went wrong with that request. Please try again.