scalacheck icon indicating copy to clipboard operation
scalacheck copied to clipboard

Vary the length of Gen.listOfN

Open ashawley opened this issue 3 years ago • 2 comments

Fixes #844.

ashawley avatar Oct 15 '21 22:10 ashawley

I will just weigh in my opinion as a user - I think changing the behaviour in this way has the potential to break too many tests. Also the current behaviour is consistent with the name listOfN. For these reasons I think it would be better to just change the documentation of listOfN and add new methods with "at most" semantics. If it's possible, calling buildableOfN for Set and Map could then be deprecated.

joroKr21 avatar Oct 16 '21 08:10 joroKr21

I agree. I raised the same concern of breaking tests in #844. The chance of generating lists less than N with listOfN is possible but usually pretty remote and actually is only possible on what your combined generator is or what the test is.

ashawley avatar Oct 16 '21 12:10 ashawley