5
votes

The forAll method takes generator(s) and performs number of checks of them. 100 checks by generator passed by default. Number of runs multiplied and you may quickly get too large if you use multiple generators.

I'd like to sort generators based on they significance and give irrelevant less checks. So I need to specify somehow how many runs of each generator is required. I looked into API for generators and for forAll method but found no clues. Neither of them take parameters that may specify check running behavior.

scalatest provides wrapper for the scalacheck's forAll method. So I'm searching solution either for a wrapper or for a original.

1
Given my answer below, you shouldn't run into situations where the number of test runs explodes. Do you have an example where you have run into any troubles?rickynils

1 Answers

2
votes

No matter how many generators you use, ScalaCheck will only run 100 (by default) tests. The forAll method doesn't know anything about how many tests to run, it will only evaluate a property one time. Test.check will call forAll the specified number of times.