Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Jul 5, 2024
1 parent 2a6ee6d commit 8995e63
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions upickle/test/src/upickle/AdvancedTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,17 @@ object AdvancedTests extends TestSuite {
// }

test("issue-371") {
val input = """{"head":"a","tail":{"head":"b","tail":null}}"""
val input = """{"head":"a","tail":{"head":"b"}}"""
val expected = Node371("a", Some(Node371("b", None)))
val result = upickle.default.read[Node371](input)
assert(result == expected)
val written = upickle.default.write(result)
assert(written == input)
}
}
}

case class Node371(head: String, tail: Option[Node371])
case class Node371(head: String, tail: Option[Node371] = None)

object Node371 {
implicit val nodeRW: ReadWriter[Node371] = macroRW[Node371]
Expand Down

0 comments on commit 8995e63

Please sign in to comment.