We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6282460 + fda0c1e commit 50fa674Copy full SHA for 50fa674
src/main/scala/org/scalacheck/Gen.scala
@@ -826,7 +826,8 @@ object Gen extends GenArities with GenVersionSpecific {
826
def nonEmptyBuildableOf[C,T](g: Gen[T])(implicit
827
evb: Buildable[T,C], evt: C => Traversable[T]
828
): Gen[C] =
829
- buildableOf(g)(evb, evt).suchThat(c => evt(c).size > 0)
+ sized(s => choose(1, Integer.max(s, 1)))
830
+ .flatMap(n => buildableOfN(n, g)(evb, evt))
831
832
/** A convenience method for calling `buildableOfN[C[T],T](n,g)`. */
833
def containerOfN[C[_],T](n: Int, g: Gen[T])(implicit
0 commit comments