Skip to content

Commit 2dbccbb

Browse files
author
Joni Freeman
committed
Add a test for already fixed bug (commit 9de55fc), fixes lift#1133
1 parent 686a8f1 commit 2dbccbb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

core/json/src/test/scala/net/liftweb/json/FieldSerializerBugs.scala

+15-1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ object FieldSerializerBugs extends Specification {
4242
str mustEqual """{"a-b*c":5}"""
4343
read[WithSymbol](str) mustEqual s
4444
}
45+
46+
"FieldSerialization should work with Options" in {
47+
implicit val formats = DefaultFormats + FieldSerializer[ClassWithOption]()
48+
49+
val t = new ClassWithOption
50+
t.field = Some(5)
51+
read[ClassWithOption](Serialization.write(t)).field mustEqual Some(5)
52+
}
53+
54+
case class WithSymbol(`a-b*c`: Int)
55+
56+
class ClassWithOption {
57+
var field: Option[Int] = None
58+
}
4559
}
4660

47-
case class WithSymbol(`a-b*c`: Int)
61+

0 commit comments

Comments
 (0)