Luv Kumar
07/11/2025, 12:08 PMassertReflectionEquals
in java), i found shouldBeEqualToComparingFields
in kotest assertions module but that is also jvm only.CLOVIS
07/11/2025, 12:21 PMCLOVIS
07/11/2025, 12:21 PM@Serializable
there may be other optionsLuv Kumar
07/11/2025, 12:57 PM@serializable
but objects are unfortunately not @serializable
, even if outer object is somehow serializable, inner nested objects also will have to be for that to work properly.
Yes reflection doesn't work well on non jvm but i was hoping if there is some multiplatform solution similar to it.
Use case: While writing tests we tend to equate full objects rather than just changed fields, to eradicate any side effects which could be caused by change of expected fields.ephemient
07/11/2025, 2:19 PMmostlyEquals
extension function or whatever you want to call it, but there's nothing built in