[spec] `(s/explain-data (s/coll-of any? :count 1) (range))` hangs

Description

Per https://ask.clojure.org/index.php/13660/s-explain-data-s-coll-of-any-count-1-range-hangs

(s/explain-data (s/coll-of any? :count 1) (range)) hangs.

The coll-prob impl has these lines:

(cond ... (c/and count (not= count (bounded-count count x))) [{:path path :pred `(= ~count (c/count ~'%)) :val x :via via :in in}] ...)

So for all non-counted collections with number of items larger than count, this branch is never triggered.
Maybe it should use (bounded-count (inc count) x) instead?

Environment

None

Activity

Show:

Details

Assignee

Reporter

Labels

Approval

Triaged

Priority

Affects versions

Created August 21, 2024 at 3:38 PM
Updated November 19, 2024 at 9:52 PM