File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 221
221
(defn- gensub
222
222
[spec overrides path rmap form]
223
223
; ;(prn {:spec spec :over overrides :path path :form form})
224
- (let [spec (c/or (get overrides spec) spec)
225
- spec (specize spec)]
226
- (if-let [g (c/or (get overrides path) (gen* spec overrides path rmap))]
224
+ (let [spec (specize spec)]
225
+ (if-let [g (c/or (get overrides (c/or (spec-name spec) spec))
226
+ (get overrides path)
227
+ (gen* spec overrides path rmap))]
227
228
(gen/such-that #(valid? spec %) g 100 )
228
229
(let [abbr (abbrev form)]
229
230
(throw (ex-info (str " Unable to construct gen at: " path " for: " abbr)
@@ -1634,12 +1635,12 @@ in ns-or-nses, a symbol or a collection of symbols."
1634
1635
(let [cargs (conform argspec args)]
1635
1636
(explain-1 fform fnspec (conj path :fn ) via in {:args cargs :ret cret})))))))))
1636
1637
{path {:pred 'ifn? :val f :via via :in in}}))
1637
- (gen* [_ _ _ _] (if gfn
1638
+ (gen* [_ overrides _ _] (if gfn
1638
1639
(gfn )
1639
1640
(gen/return
1640
1641
(fn [& args]
1641
1642
(assert (valid? argspec args) (with-out-str (explain argspec args)))
1642
- (gen/generate (gen retspec))))))
1643
+ (gen/generate (gen retspec overrides ))))))
1643
1644
(with-gen* [_ gfn] (fspec-impl argspec aform retspec rform fnspec fform gfn))
1644
1645
(describe* [_] `(fspec :args ~aform :ret ~rform :fn ~fform)))))
1645
1646
You can’t perform that action at this time.
0 commit comments