From 5b13edc47347481fc53c74ff15773c074da6a37b Mon Sep 17 00:00:00 2001 From: mpilquist Date: Sat, 2 Oct 2021 09:36:27 -0400 Subject: [PATCH] Fix bug where string sizes would not grow beyong a single character --- core/shared/src/main/scala/org/scalacheck/effect/PropF.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/shared/src/main/scala/org/scalacheck/effect/PropF.scala b/core/shared/src/main/scala/org/scalacheck/effect/PropF.scala index 1bca58f..b894672 100644 --- a/core/shared/src/main/scala/org/scalacheck/effect/PropF.scala +++ b/core/shared/src/main/scala/org/scalacheck/effect/PropF.scala @@ -77,7 +77,7 @@ sealed trait PropF[F[_]] { ): F[Test.Result] = { import testParams.{minSuccessfulTests, minSize, maxDiscardRatio, maxSize} - val sizeStep = (maxSize - minSize) / minSuccessfulTests + val sizeStep = (maxSize - minSize) / minSuccessfulTests.toDouble val maxDiscarded = minSuccessfulTests * maxDiscardRatio def loop(params: Gen.Parameters, passed: Int, discarded: Int): F[Test.Result] = { @@ -86,7 +86,8 @@ sealed trait PropF[F[_]] { else if (discarded >= maxDiscarded) F.pure(Test.Result(Test.Exhausted, passed, discarded, FreqMap.empty)) else { - val size = minSize.toDouble + sizeStep + val count = passed + discarded + val size = minSize.toDouble + (sizeStep * count) checkOne(params.withSize(size.round.toInt)).flatMap { result => result.status match { case Prop.True =>