Hi,
Is there a way to run the ScalaCheck-style properties based test cases in a deterministic way? For example, given a test
class SomeTest extends FunSpec with ScalaCheckDrivenPropertyChecks {
it("tests a property with many random values") {
forAll { (someRandomValue: Int) =>
// test something with someRandomValue
}
}
}
ScalaTest would print the failure message completed with the
Occurred when passed generated values (
arg0 = 0 // 3 shrinks
)
text when the test case fails, but next time I run it, the test may pass or fail with a different value. Using the printed generated value I could write another test case to debug the problem but ideally it should be possible to re-run the same test using the same seed that generated the problematic random value. ScalaCheck has something called propertyWithSeed() that prints out the seed on failure which then can be used as an argument to propertyWithSeed() to re-run the test case.
Is there a way to achieve this in ScalaTest?