Skip to content

Commit dfdb6a1

Browse files
committed
More test assertions for generic and named tuples
1 parent 35167c0 commit dfdb6a1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

jsoniter-scala-macros/shared/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerNewTypeSpec.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class JsonCodecMakerNewTypeSpec extends VerifyingSpec {
7070
verifySerDeser(make[Tuple.Concat[(Byte, Short), (Int, Long)]], (1: Byte, 2: Short, 3, 4L), "[1,2,3,4]")
7171
verifySerDeser(make[Tuple.Drop[(Long, Int, String), 1]], (1, "VVV"), """[1,"VVV"]""")
7272
verifySerDeser(make[Tuple.Take[(Int, String, Long), 2]], (1, "VVV"), """[1,"VVV"]""")
73+
verifySerDeser(make[Tuple.Zip[Tuple1[Int], Tuple1[String]]], (1, "VVV") *: EmptyTuple, """[[1,"VVV"]]""")
74+
verifySerDeser(make[Tuple.Map[(Int, String), Option]], (Some(1), Some("VVV")), """[1,"VVV"]""")
75+
verifySerDeser(make[Tuple.InverseMap[(Option[Int], Option[String]), Option]], (1, "VVV"), """[1,"VVV"]""")
7376
}
7477
"serialize and deserialize immutable arrays" in {
7578
val json = """{"aa":[[1,2],[3,4]],"a":[1,2,3,4]}"""

jsoniter-scala-next-tests/shared/src/test/scala-3/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerNamedTupleSpec.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class JsonCodecMakerNamedTupleSpec extends VerifyingSpec {
4747
((i = 1, s = "VVV"), (l = 2L)), """[{"i":1,"s":"VVV"},{"l":2}]""")
4848
verifySerDeser(make[NamedTuple.Zip[(i: Int, s: String), (i: Long, s: String)]],
4949
(i = (1, 2L), s = ("VVV", "WWW")), """{"i":[1,2],"s":["VVV","WWW"]}""")
50+
verifySerDeser(make[NamedTuple.Map[(i: Int, s: String), Option]],
51+
(i = Some(1), s = Some("VVV")), """{"i":1,"s":"VVV"}""")
5052
}
5153
"serialize and deserialize nested named tuples" in {
5254
verifySerDeser(make[(i: Int, t: (d: Double, s: String))], (i = 1, t = (d = 2.0, s = "VVV")),

0 commit comments

Comments
 (0)