Closed dmateusp closed 3 years ago
I would give https://github.com/tek/splain a try (btw it will be soon merged into Scala proper)
@joroKr21 thanks for the suggestion, I tried adding:
addCompilerPlugin("io.tryp" % "splain" % "0.5.8" cross CrossVersion.patch),
which pointed me to a missing implicit for Joda Date, which I fixed using
implicit val genJodaLocalDate: Arbitrary[LocalDate] = Arbitrary(genDateTime.map(_.toLocalDate()))
Thanks a lot!
I'm trying to generate an
Arbitrary
for a pretty long class which has many types, the class is itself generated through a macro (using a library called SCIO Beam).For a simple generated class I'm able to use scalacheck-shapeless to generate an Arbitrary instance, but for a bigger class I'm not able to. How can I debug why generating the implicit failed? I imagine one cause could be a specific type for which no Arbitrary was found?
To illustrate, this is working:
But for another class generated from a BigQuery table with many columns, it's not finding the implicit.
Do I have a way to explicitly invoke what generates the implicit method that we fetch with
implicitly[Arbitrary[Test]]
? And grab the potential Failure?