Skip to content

Commit 7222307

Browse files
authored
Add missing tests for inlining of "one value" classes
1 parent 94229b5 commit 7222307

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,12 +1259,24 @@ class JsonCodecMakerSpec extends VerifyingSpec {
12591259
verifySerDeser(make[Array[OrderId]](CodecMakerConfig.withInlineOneValueClasses(true)),
12601260
_root_.scala.Array(OrderId(123123), OrderId(123456)), "[123123,123456]")
12611261
}
1262-
"serialize and deserialize collection fields of one value classes" in {
1262+
"serialize and deserialize a collection field of one value classes" in {
12631263
case class UserIds(l: List[String])
12641264

12651265
verifySerDeser(make[UserIds](CodecMakerConfig.withInlineOneValueClasses(true)),
12661266
UserIds(List("VVV", "WWW")), """["VVV","WWW"]""")
12671267
}
1268+
"serialize and deserialize a generic type field of one value classes" in {
1269+
case class UserIds[T](l: T)
1270+
1271+
verifySerDeser(make[UserIds[List[String]]](CodecMakerConfig.withInlineOneValueClasses(true)),
1272+
UserIds(List("VVV", "WWW")), """["VVV","WWW"]""")
1273+
}
1274+
"serialize and deserialize a higher kind type field of one value classes" in {
1275+
case class UserIds[F[_], A](l: F[A])
1276+
1277+
verifySerDeser(make[UserIds[List, String]](CodecMakerConfig.withInlineOneValueClasses(true)),
1278+
UserIds(List("VVV", "WWW")), """["VVV","WWW"]""")
1279+
}
12681280
"serialize and deserialize case classes with options" in {
12691281
verifySerDeser(codecOfOptions,
12701282
Options(Option("VVV"), Option(BigInt(4)), Option(Set()), Option(1L), Option(_root_.java.lang.Long.valueOf(2L)),

0 commit comments

Comments
 (0)