[spec] coll-of :min-count and :gen-max used together cause collections that are too large to be generated

Description

This should specify a spec whose generator always returns collections of size 4 or 5 but instead it generates collections of size 4 to 8:

Cause: The max logic in s/every-impl is: (c/or max-count (max gen-max (c/* 2 (c/or min-count 0)))). If there is a max-count it's used, otherwise the larger of gen-max or 2*min-count is used. In this case, 2*min-count is 8. Seems like we should never generate more than gen-max though, so propose changing this logic to: (c/or max-count gen-max (c/* 2 (c/or min-count 0))).

Patch: clj-2202.patch

Environment

1.9.0-alpha16

Assignee

Unassigned

Reporter

import

Labels

Approval

Vetted

Patch

Code

Affects versions

Priority

Minor
Configure