You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectScalaCheckCheckextendsProperties("Gen.choose[BigInt]"):overridedefoverrideParameters( params: Parameters ):Parameters= params.withMinSuccessfulTests(1_000_000)
property("covers all bit lengths") = forAll(
Gen.choose[BigInt](0, BigInt(1) <<64)
)( _.bitLength >32 )
endScalaCheckCheck
But since Gen.choose[BigInt] samples uniformly, the chances of the test above (correctly) failing are less than 3 in 10_000.
The documentation does not mandate that Gen.choose[BigInt] samples uniformly, so I propose adding the following edge cases and sampling methods to Choose[BigInt]:
{0, ±1, ±2, ± Byte.MaxValue ± 1, ± Short.MaxValue ± 1, ...} (provided they are in range)
Randomly chosen small primes or probable primes
Products of 2 or 3 small/probable primes
Random Powers of 2
"Sparse" BigInt values with uniformly random bitLength and uniformly random number of 1-bits
If these additions are acceptable, I would be willing to work on an according PR.
The text was updated successfully, but these errors were encountered:
The following property test should clearly fail:
But since
Gen.choose[BigInt]
samples uniformly, the chances of the test above (correctly) failing are less than 3 in 10_000.The documentation does not mandate that
Gen.choose[BigInt]
samples uniformly, so I propose adding the following edge cases and sampling methods toChoose[BigInt]
:{0, ±1, ±2, ± Byte.MaxValue ± 1, ± Short.MaxValue ± 1, ...}
(provided they are in range)BigInt
values with uniformly random bitLength and uniformly random number of 1-bitsIf these additions are acceptable, I would be willing to work on an according PR.
The text was updated successfully, but these errors were encountered: