Skip to content

Instantly share code, notes, and snippets.

View peri4n's full-sized avatar
🎯
Focusing

Fabian Bull peri4n

🎯
Focusing
View GitHub Profile
@peri4n
peri4n / Shrinking.scala
Created July 20, 2018 20:29 — forked from davidallsopp/Shrinking.scala
Solutions to the ScalaCheck problem that shrinking failing values may generate invalid values, because the constraints of the generator are not respected. This is for using ScalaCheck from within ScalaTest.
import org.scalatest._
import prop._
import org.scalacheck.Arbitrary._
import org.scalacheck.Gen
/**
* Solutions to the ScalaCheck problem that shrinking failing values may generate
* invalid values, because the constraints of the generator are not respected.
*
* See also http://stackoverflow.com/questions/20037900/scalacheck-wont-properly-report-the-failing-case