Created
July 12, 2011 05:21
-
-
Save tc/1077437 to your computer and use it in GitHub Desktop.
lift-json 2.4M1 incorrectly parsing option classes?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.junit.{Test, Assert} | |
import org.junit.Assert._ | |
import net.liftweb.json._ | |
import net.liftweb.json.Serialization.write | |
case class Library(name:String, docs:List[Option[String]]) | |
class AppTest{ | |
@Test | |
def testMain{ | |
implicit val formats = Serialization.formats(NoTypeHints) | |
val content = """ | |
{"name":"test", "docs": ["1", "2"]} | |
""" | |
val lib = parse(content).extract[Library] | |
println(lib) | |
assertEquals(List(Some("1"), Some("2")), lib.docs) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment