Skip to content

Commit

Permalink
Fix "Gen.frequency 3" test
Browse files Browse the repository at this point in the history
With `n == 0` the test effectively calls `Gen.frequency()`, which
throws `IllegalArgumentException: no items with positive weights`.
  • Loading branch information
lrytz committed Jun 7, 2018
1 parent 12c8a66 commit 6e1afc5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jvm/src/test/scala/org/scalacheck/GenSpecification.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object GenSpecification extends Properties("Gen") with GenSpecificationVersionSp
forAll(g) { n => true }
}

property("frequency 3") = forAll(choose(0,100000)) { n =>
property("frequency 3") = forAll(choose(1,100000)) { n =>
forAll(frequency(List.fill(n)((1,const(0))): _*)) { _ == 0 }
}

Expand Down

0 comments on commit 6e1afc5

Please sign in to comment.