Skip to content

Commit 77d9077

Browse files
mfikesdnolen
authored andcommitted
CLJS-1944: Can't spec generate non-vector collections
We need to not default gen-into as [], otherwise kind will not be used when in the gen* implementation. The fix involves simply copying over a missed change when Clojure 23e3ec3f8 was copied as ClojureScript cd43ec9.
1 parent 23beecb commit 77d9077

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/main/cljs/cljs/spec.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@
795795
([form pred {gen-into :into
796796
:keys [kind ::kind-form count max-count min-count distinct gen-max ::kfn ::cpred
797797
conform-keys ::conform-all]
798-
:or {gen-max 20, gen-into []}
798+
:or {gen-max 20}
799799
:as opts}
800800
gfn]
801801
(let [conform-into gen-into

src/test/cljs/cljs/spec_test.cljs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@
100100
(is (= :b (s/conform ::multi :b)))
101101
(is (= :a (s/conform ::multi :a))))
102102

103+
(deftest test-cljs-1944
104+
(is (not-empty (s/exercise (s/coll-of string? :kind set?)))))
105+
103106
;; Copied from Clojure spec tests
104107

105108
(def even-count? #(even? (count %)))

0 commit comments

Comments
 (0)