Skip to content

Commit 9934ab2

Browse files
committed
Add missing test for case classes with multiple parameter lists in a primary constructor that has default values in the first parameter list
1 parent 9162666 commit 9934ab2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3022,6 +3022,13 @@ class JsonCodecMakerSpec extends VerifyingSpec {
30223022

30233023
verifySerDeser(make[MultiListOfArgs], new MultiListOfArgs(1)(2)("VVV"), """{"i":1,"l":2,"s":"VVV"}""")
30243024
}
3025+
"generate codecs for case classes with multiple parameter lists in a primary constructor that has default values in the first parameter list" in {
3026+
case class MultiListOfArgs(i: Int = 1)(val l: Long)(var s: String)
3027+
3028+
verifySerDeser(make[MultiListOfArgs], new MultiListOfArgs()(2)("VVV"), """{"l":2,"s":"VVV"}""")
3029+
verifySerDeser(makeWithRequiredDefaultFields[MultiListOfArgs],
3030+
new MultiListOfArgs()(2)("VVV"), """{"i":1,"l":2,"s":"VVV"}""")
3031+
}
30253032
"generate codecs for case classes with multiple parameter lists in a primary constructor with depended default values when the requireDefaultFields is on" in {
30263033
case class MultiListOfArgs(i: Int = 1)(val l: Long = i - 1)(var s: String = l.toString)
30273034

0 commit comments

Comments
 (0)