Skip to content

Commit 4848ee8

Browse files
committed
Fix "Gen.frequency 3" test
With `n == 0` the test effectively calls `Gen.frequency()`, which throws `IllegalArgumentException: no items with positive weights`.
1 parent 12c8a66 commit 4848ee8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jvm/src/test/scala/org/scalacheck/GenSpecification.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ object GenSpecification extends Properties("Gen") with GenSpecificationVersionSp
5454
forAll(g) { n => true }
5555
}
5656

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

0 commit comments

Comments
 (0)