File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 263263 See 'fdef' for a single operation that creates an fspec and
264264 registers it, as well as a full description of :args, :ret and :fn
265265
266+ fspecs can generate functions that validate the arguments and
267+ fabricate a return value compliant with the :ret spec, ignoring
268+ the :fn spec if present.
269+
266270 Optionally takes :gen generator-fn, which must be a fn of no args
267271 that returns a test.check generator."
268272 [& {:keys [args ret fn gen]}]
Original file line number Diff line number Diff line change 10751075 {path {:pred 'ifn? :val f :via via :in in}}))
10761076 (gen* [_ _ _ _] (if gfn
10771077 (gfn )
1078- (when-not fnspec
1079- (gen/return
1080- (fn [& args]
1081- (assert (valid? argspec args) (with-out-str (explain argspec args)))
1082- (gen/generate (gen retspec)))))))
1078+ (gen/return
1079+ (fn [& args]
1080+ (assert (valid? argspec args) (with-out-str (explain argspec args)))
1081+ (gen/generate (gen retspec))))))
10831082 (with-gen* [_ gfn] (fspec-impl argspec aform retspec rform fnspec fform gfn))
10841083 (describe* [_] `(fspec :args ~aform :ret ~rform :fn ~fform)))))
10851084
You can’t perform that action at this time.
0 commit comments