File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 263
263
See 'fdef' for a single operation that creates an fspec and
264
264
registers it, as well as a full description of :args, :ret and :fn
265
265
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
+
266
270
Optionally takes :gen generator-fn, which must be a fn of no args
267
271
that returns a test.check generator."
268
272
[& {:keys [args ret fn gen]}]
Original file line number Diff line number Diff line change 1075
1075
{path {:pred 'ifn? :val f :via via :in in}}))
1076
1076
(gen* [_ _ _ _] (if gfn
1077
1077
(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))))))
1083
1082
(with-gen* [_ gfn] (fspec-impl argspec aform retspec rform fnspec fform gfn))
1084
1083
(describe* [_] `(fspec :args ~aform :ret ~rform :fn ~fform)))))
1085
1084
You can’t perform that action at this time.
0 commit comments